2016-05-30 00:29:30 +00:00
|
|
|
#!/usr/bin/env node
|
|
|
|
"use strict";
|
|
|
|
require("typings-global");
|
|
|
|
var plugins = require("./npmci.plugins");
|
2016-06-09 01:42:12 +00:00
|
|
|
var paths = require("./npmci.paths");
|
|
|
|
var npmciInfo = new plugins.projectinfo.ProjectinfoNpm(paths.NpmciPackageRoot);
|
|
|
|
plugins.beautylog.log("npmci version: " + npmciInfo.version);
|
2016-06-02 23:58:37 +00:00
|
|
|
var npmci_build_1 = require("./npmci.build");
|
2016-05-30 00:29:30 +00:00
|
|
|
var npmci_install_1 = require("./npmci.install");
|
|
|
|
var npmci_publish_1 = require("./npmci.publish");
|
2016-06-02 11:08:15 +00:00
|
|
|
var npmci_prepare_1 = require("./npmci.prepare");
|
2016-06-02 23:58:37 +00:00
|
|
|
var npmci_test_1 = require("./npmci.test");
|
2016-06-01 04:49:59 +00:00
|
|
|
var npmci_trigger_1 = require("./npmci.trigger");
|
2016-06-07 10:36:00 +00:00
|
|
|
var NpmciEnv = require("./npmci.env");
|
2016-06-10 06:07:04 +00:00
|
|
|
var npmci_build_2 = require("./npmci.build");
|
|
|
|
exports.build = npmci_build_2.build;
|
|
|
|
var npmci_install_2 = require("./npmci.install");
|
|
|
|
exports.install = npmci_install_2.install;
|
|
|
|
var npmci_publish_2 = require("./npmci.publish");
|
|
|
|
exports.publish = npmci_publish_2.publish;
|
2016-05-30 00:29:30 +00:00
|
|
|
var command;
|
|
|
|
var commandOption;
|
|
|
|
plugins.commander
|
|
|
|
.arguments('<commandarg> [commandoptionarg]')
|
|
|
|
.action(function (commandarg, commandoptionarg) {
|
|
|
|
command = commandarg;
|
|
|
|
commandOption = commandoptionarg;
|
|
|
|
});
|
|
|
|
plugins.commander.parse(process.argv);
|
|
|
|
if (typeof command === 'undefined') {
|
|
|
|
console.error('no command given!');
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
switch (command) {
|
2016-06-02 23:58:37 +00:00
|
|
|
case "build":
|
2016-06-07 10:36:00 +00:00
|
|
|
npmci_build_1.build(commandOption)
|
|
|
|
.then(NpmciEnv.configStore);
|
2016-06-02 23:58:37 +00:00
|
|
|
break;
|
2016-05-30 00:29:30 +00:00
|
|
|
case "install":
|
2016-06-07 10:36:00 +00:00
|
|
|
npmci_install_1.install(commandOption)
|
|
|
|
.then(NpmciEnv.configStore);
|
|
|
|
;
|
2016-05-30 00:29:30 +00:00
|
|
|
break;
|
2016-06-01 03:44:48 +00:00
|
|
|
case "prepare":
|
2016-06-07 10:36:00 +00:00
|
|
|
npmci_prepare_1.prepare(commandOption)
|
|
|
|
.then(NpmciEnv.configStore);
|
|
|
|
;
|
2016-06-01 03:44:48 +00:00
|
|
|
break;
|
2016-05-30 00:29:30 +00:00
|
|
|
case "publish":
|
2016-06-07 10:36:00 +00:00
|
|
|
npmci_publish_1.publish(commandOption)
|
|
|
|
.then(NpmciEnv.configStore);
|
|
|
|
;
|
2016-05-30 00:29:30 +00:00
|
|
|
break;
|
2016-06-02 17:35:01 +00:00
|
|
|
case "test":
|
2016-06-07 10:36:00 +00:00
|
|
|
npmci_test_1.test(commandOption)
|
|
|
|
.then(NpmciEnv.configStore);
|
2016-06-02 17:35:01 +00:00
|
|
|
break;
|
|
|
|
case "trigger":
|
|
|
|
npmci_trigger_1.trigger();
|
|
|
|
break;
|
2016-05-30 00:29:30 +00:00
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2016-06-10 06:07:04 +00:00
|
|
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQ0EsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBQ3hCLElBQVksT0FBTyxXQUFNLGlCQUFpQixDQUFDLENBQUE7QUFDM0MsSUFBWSxLQUFLLFdBQU0sZUFBZSxDQUFDLENBQUE7QUFDdkMsSUFBSSxTQUFTL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