74 lines
7.7 KiB
JavaScript
74 lines
7.7 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_command_1 = require("./npmci.command");
|
|
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 npmci_build_2 = require("./npmci.build");
|
|
exports.build = npmci_build_2.build;
|
|
var npmci_install_2 = require("./npmci.install");
|
|
exports.install = npmci_install_2.install;
|
|
var npmci_publish_2 = require("./npmci.publish");
|
|
exports.publish = npmci_publish_2.publish;
|
|
var command;
|
|
var commandOption;
|
|
plugins.commander
|
|
.version(npmciInfo.version)
|
|
.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 "command":
|
|
npmci_command_1.command()
|
|
.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:
|
|
plugins.beautylog.error("command " + commandOption.blue + " not recognised");
|
|
process.exit(1);
|
|
break;
|
|
}
|
|
|
|
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQ0EsUUFBTyxnQkFBZ0IsQ0FBQyxDQUFBO0FBQ3hCLElBQVksT0FBTyxXQUFNLGlCQUFpQixDQUFDLENBQUE7QUFDM0MsSUFBWSxLQUFLLFdBQU0sZUFBZSxDQUFDLENBQUE7QUFDdkMsSUFBSSxTQUFTLEdBQUcsSUFBSSxPQUFPLENBQUMsV0FBVyxDQUFDLGNBQWMsQ0FBQyxLQUFLLENBQUMsZ0JBQWdCLENBQUMsQ0FBQztBQUMvRSxPQUFPLENBQUMsU0FBUyxDQUFDLEdBQUcsQ0FBQyxpQkFBaUIsR0FBRyxTQUFTLENBQUMsT0FBTyxDQUFDLENBQUM7QUFFN0QsNEJBQW9CLGVBQ3BCLENBQUMsQ0FEa0M7QUFDbkMsOEJBQWtDLGlCQUFpQixDQUFDLENBQUE7QUFDcEQsOEJBQXNCLGlCQUFpQixDQUFDLENBQUE7QUFDeEMsOEJBQXNCLGlCQUFpQixDQUFDLENBQUE7QUFDeEMsOEJBQXNCLGlCQUFpQixDQUFDLENBQUE7QUFFeEMsMkJBQW1CLGNBQWMsQ0FBQyxDQUFBO0FBQ2xDLDhCQUFzQixpQkFBaUIsQ0FBQyxDQUFBO0FBQ3hDLElBQVksUUFBUSxXQUFNLGFBQWEsQ0FBQyxDQUFBO0FBRXhDLDRCQUFvQixlQUNwQixDQUFDO0FBRE8sb0NBQTJCO0FBQ25DLDhCQUFzQixpQkFBa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