npmci/dist/index.js

59 lines
6.0 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-06-07 10:36:00 +00:00
var NpmciEnv = require("./npmci.env");
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-07 10:36:00 +00:00
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQ0EsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBQ3hCLElBQVksT0FBTyxXQUFNLGlCQUFpQixDQUFDLENBQUE7QUFFM0MsSUFBSSxRQUFRLEdBQUcsT0FBTyxDQUFDLGlCQUFpQixDQUFDLENBQUM7QUFFMUMsT0FBTyxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsaUJBQWlCLEdBQUcsUUFBUSxDQUFDLE9BQU8sQ0FBQyxDQUFDO0FBRTdELDRCQUFvQixlQUNwQixDQUFDLENBRGtDO0FBQ25DLDhCQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBQ3hDLDhCQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBQ3hDLDhCQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBRXhDLDJCQUFtQixjQUFjLENBQUMsQ0FBQTtBQUNsQyw4QkFBc0IsaUJBQWlCLENBQUMsQ0FBQTtBQUN4QyxJQUFZLFFBQVEsV0FBTSxhQUFhLENBQUMsQ0FBQTtBQUd4QyxJQUFJLE9BQU8sQ0FBQztBQUNaLElBQUksYUFBYSxDQUFDO0FBRWxCLE9BQU8sQ0FBQyxTQUFTO0tBQ1osU0FBUyxDQUFDLGlDQUFpQyxDQUFDO0tBQzVDLE1BQU0sQ0FBQyxVQUFVLFVBQVUsRUFBRSxnQkFBZ0I7SUFDMUMsT0FBTyxHQUFHLFVBQVUsQ0FBQztJQUNyQixhQUFhLEdBQUcsZ0JBQWdCLENBQUM7QUFDckMsQ0FBQyxDQUFDLENBQUM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