tscoverage/ts/npmts.configfile.ts

36 lines
1.0 KiB
TypeScript
Raw Normal View History

2016-05-25 03:23:48 +00:00
import "typings-global";
2016-02-19 23:53:23 +00:00
import plugins = require("./npmts.plugins");
import paths = require("./npmts.paths");
2016-07-17 15:13:47 +00:00
import {npmtsOra} from "./npmts.promisechain";
2016-06-16 01:02:33 +00:00
export var run = function(argvArg){
2016-07-17 15:13:47 +00:00
let done = plugins.Q.defer();
npmtsOra.text("looking for npmextra.json");
let defaultConfig = {
mode: "default",
2016-08-13 21:54:17 +00:00
notest:false,
nodocs:false
2016-07-17 15:13:47 +00:00
};
2016-06-16 01:02:33 +00:00
if(argvArg.notest){
2016-07-17 15:13:47 +00:00
defaultConfig.notest = true;
};
2016-08-13 21:54:17 +00:00
if(argvArg.nodocs){
defaultConfig.nodocs = true;
};
2016-07-17 15:13:47 +00:00
let config = plugins.npmextra.dataFor({
toolName:"npmts",
defaultSettings:defaultConfig,
cwd:paths.cwd
});
switch (config.mode){
case "default":
case "custom":
plugins.beautylog.ok("mode is " + config.mode.yellow);
done.resolve(config);
break;
default:
plugins.beautylog.error("mode " + config.mode.yellow + " not recognised!".red);
process.exit(1);
2016-02-19 23:53:23 +00:00
};
2016-07-17 15:13:47 +00:00
done.resolve(config);
2016-02-19 23:53:23 +00:00
return done.promise;
};