47 lines
4.7 KiB
JavaScript
47 lines
4.7 KiB
JavaScript
#!/usr/bin/env node
|
|
"use strict";
|
|
require("typings-global");
|
|
var plugins = require("./npmci.plugins");
|
|
var packJson = require("../package.json");
|
|
plugins.beautylog.info("npmci version: " + packJson.version);
|
|
var npmci_install_1 = require("./npmci.install");
|
|
var npmci_test_1 = require("./npmci.test");
|
|
var npmci_publish_1 = require("./npmci.publish");
|
|
var npmci_prepare_1 = require("./npmci.prepare");
|
|
var npmci_trigger_1 = require("./npmci.trigger");
|
|
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) {
|
|
case "install":
|
|
npmci_install_1.install(commandOption);
|
|
break;
|
|
case "prepare":
|
|
npmci_prepare_1.prepare(commandOption);
|
|
break;
|
|
case "publish":
|
|
npmci_publish_1.publish(commandOption)
|
|
.then(npmci_trigger_1.trigger);
|
|
break;
|
|
case "test":
|
|
npmci_test_1.test(commandOption);
|
|
break;
|
|
case "trigger":
|
|
npmci_trigger_1.trigger();
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
|
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQ0EsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBQ3hCLElBQVksT0FBTyxXQUFNLGlCQUFpQixDQUFDLENBQUE7QUFFM0MsSUFBSSxRQUFRLEdBQUcsT0FBTyxDQUFDLGlCQUFpQixDQUFDLENBQUM7QUFFMUMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsaUJBQWlCLEdBQU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