npmci/dist/index.js

50 lines
4.9 KiB
JavaScript
Raw 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-05-30 01:19:07 +00:00
var packJson = require("../package.json");
2016-05-30 03:40:02 +00:00
plugins.beautylog.info("npmci version: " + packJson.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-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":
npmci_build_1.build("commandArg");
break;
2016-05-30 00:29:30 +00:00
case "install":
npmci_install_1.install(commandOption);
break;
2016-06-01 03:44:48 +00:00
case "prepare":
2016-06-02 11:08:15 +00:00
npmci_prepare_1.prepare(commandOption);
2016-06-01 03:44:48 +00:00
break;
2016-05-30 00:29:30 +00:00
case "publish":
npmci_publish_1.publish(commandOption);
2016-05-30 00:29:30 +00:00
break;
2016-06-02 17:35:01 +00:00
case "test":
npmci_test_1.test(commandOption);
break;
case "trigger":
npmci_trigger_1.trigger();
break;
2016-05-30 00:29:30 +00:00
default:
break;
}
2016-06-04 21:20:39 +00:00
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQ0EsUUFBTyxnQkFBZ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