npmci/dist/index.js

50 lines
5.1 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_build_1 = require("./npmci.build");
var npmci_install_1 = require("./npmci.install");
var npmci_publish_1 = require("./npmci.publish");
var npmci_prepare_1 = require("./npmci.prepare");
var npmci_test_1 = require("./npmci.test");
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 "build":
npmci_build_1.build(commandOption);
break;
case "install":
npmci_install_1.install(commandOption);
break;
case "prepare":
npmci_prepare_1.prepare(commandOption);
break;
case "publish":
npmci_publish_1.publish(commandOption);
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQ0EsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBQ3hCLElBQVksT0FBTyxXQUFNLGlCQUFpQixDQUFDLENBQUE7QUFFM0MsSUFBSSxRQUFRLEdBQUcsT0FBTyxDQUFDLGlCQUFpQixDQUFDLENBQUM7QUFFMUMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsaUJBQWlCLEdBQUcsUUFBUSxDQUFDLE9BQU8sQ0FBQyxDQUFDO0FBRTdELDRCQUFvQixlQUNwQixDQUFDLENBRGtDO0FBQ25DLDhCQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBQ3hDLDhCQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBQ3hDL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