tscoverage/dist/npmts.configfile.js

36 lines
1014 B
JavaScript
Raw Normal View History

2016-03-12 09:21:16 +00:00
"use strict";
2016-05-25 03:23:48 +00:00
require("typings-global");
2016-02-19 23:53:23 +00:00
var plugins = require("./npmts.plugins");
var paths = require("./npmts.paths");
2016-07-17 15:13:47 +00:00
var npmts_promisechain_1 = require("./npmts.promisechain");
2016-06-16 01:02:33 +00:00
exports.run = function (argvArg) {
2016-02-22 21:22:39 +00:00
var done = plugins.Q.defer();
2016-07-17 15:13:47 +00:00
npmts_promisechain_1.npmtsOra.text("looking for npmextra.json");
var 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;
2016-06-16 01:02:33 +00:00
}
2016-07-17 15:13:47 +00:00
;
var 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;
};