npmci/dist/index.js

73 lines
7.6 KiB
JavaScript
Raw Permalink Normal View History

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-06-11 18:44:56 +00:00
var npmci_command_1 = require("./npmci.command");
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");
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-06-11 18:22:00 +00:00
case "command":
2016-06-11 18:44:56 +00:00
npmci_command_1.command()
2016-06-11 18:22:00 +00:00
.then(NpmciEnv.configStore);
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:
2016-06-11 18:22:00 +00:00
plugins.beautylog.error("command " + commandOption.blue + " not recognised");
process.exit(1);
2016-05-30 00:29:30 +00:00
break;
}
2016-06-11 18:44:56 +00:00
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQ0EsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBQ3hCLElBQVksT0FBTyxXQUFNLGlCQUFpQixDQUFDLENBQUE7QUFDM0MsSUFBWSxLQUFLLFdBQU0sZUFBZSxDQUFDLENBQUE7QUFDdkMsSUFBSSxTQUFTLEdBQUcsSUFBSSxPQUFPLENBQUMsV0FBVyxDQUFDLGNBQWMsQ0FBQyxLQUFLLENBQUMsZ0JBQWdCLENBQUMsQ0FBQztBQUMvRSxPQUFPLENBQUMsU0FBUyxDQUFDLEdBQUcsQ0FBQyxpQkFBaUIsR0FBRyxTQUFTLENBQUMsT0FBTyxDQUFDLENBQUM7QUFFN0QsNEJBQW9CLGVBQ3BCLENBQUMsQ0FEa0M7QUFDbkMsOEJBQWtDLGlCQUFpQixDQUFDLENBQUE7QUFDcEQsOEJBQXNCLGlCQUFpQixDQUF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