tscoverage/ts/npmts.configfile.ts

32 lines
953 B
TypeScript
Raw Permalink 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",
notest:false
};
2016-06-16 01:02:33 +00:00
if(argvArg.notest){
2016-07-17 15:13:47 +00:00
defaultConfig.notest = true;
};
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;
};