npmci/dist/index.js
2016-06-09 03:42:12 +02:00

60 lines
6.1 KiB
JavaScript

#!/usr/bin/env node
"use strict";
require("typings-global");
var plugins = require("./npmci.plugins");
var paths = require("./npmci.paths");
var npmciInfo = new plugins.projectinfo.ProjectinfoNpm(paths.NpmciPackageRoot);
plugins.beautylog.log("npmci version: " + npmciInfo.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 NpmciEnv = require("./npmci.env");
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)
.then(NpmciEnv.configStore);
break;
case "install":
npmci_install_1.install(commandOption)
.then(NpmciEnv.configStore);
;
break;
case "prepare":
npmci_prepare_1.prepare(commandOption)
.then(NpmciEnv.configStore);
;
break;
case "publish":
npmci_publish_1.publish(commandOption)
.then(NpmciEnv.configStore);
;
break;
case "test":
npmci_test_1.test(commandOption)
.then(NpmciEnv.configStore);
break;
case "trigger":
npmci_trigger_1.trigger();
break;
default:
break;
}
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQ0EsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBQ3hCLElBQVksT0FBTyxXQUFNLGlCQUFpQixDQUFDLENBQUE7QUFDM0MsSUFBWSxLQUFLLFdBQU0sZUFBZSxDQUFDLENBQUE7QUFDdkMsSUFBSSxTQUFTLEdBQUcsSUFBSSxPQUFPLENBQUMsV0FBVyxDQUFDLGNBQWM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