npmci/dist/index.js

81 lines
5.1 KiB
JavaScript
Raw Normal View History

2016-05-30 00:29:30 +00:00
#!/usr/bin/env node
"use strict";
require("typings-global");
2016-07-18 14:56:53 +00:00
const plugins = require("./npmci.plugins");
const paths = require("./npmci.paths");
let npmciInfo = new plugins.projectinfo.ProjectinfoNpm(paths.NpmciPackageRoot);
2016-11-24 22:21:40 +00:00
plugins.beautylog.log('npmci version: ' + npmciInfo.version);
2016-07-18 14:56:53 +00:00
const npmci_build_1 = require("./npmci.build");
const npmci_clean_1 = require("./npmci.clean");
const npmci_command_1 = require("./npmci.command");
const npmci_install_1 = require("./npmci.install");
const npmci_publish_1 = require("./npmci.publish");
const npmci_prepare_1 = require("./npmci.prepare");
const npmci_test_1 = require("./npmci.test");
const npmci_trigger_1 = require("./npmci.trigger");
const 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;
2016-07-18 14:56:53 +00:00
let smartcli = new plugins.smartcli.Smartcli();
2016-06-25 10:28:51 +00:00
smartcli.addVersion(npmciInfo.version);
// build
smartcli.addCommand({
2016-11-24 22:21:40 +00:00
commandName: 'build'
2016-07-18 14:56:53 +00:00
}).then((argv) => {
2016-06-25 10:28:51 +00:00
npmci_build_1.build(argv._[1])
.then(NpmciEnv.configStore);
2016-05-30 00:29:30 +00:00
});
2016-06-26 02:54:10 +00:00
// clean
smartcli.addCommand({
2016-11-24 22:21:40 +00:00
commandName: 'clean'
2016-07-18 14:56:53 +00:00
}).then((argv) => {
2016-06-26 02:54:10 +00:00
npmci_clean_1.clean()
.then(NpmciEnv.configStore);
});
2016-06-25 10:28:51 +00:00
// command
smartcli.addCommand({
2016-11-24 22:21:40 +00:00
commandName: 'command'
2016-07-18 14:56:53 +00:00
}).then((argv) => {
2016-06-25 10:28:51 +00:00
npmci_command_1.command()
.then(NpmciEnv.configStore);
});
// install
smartcli.addCommand({
2016-11-24 22:21:40 +00:00
commandName: 'install'
2016-07-18 14:56:53 +00:00
}).then((argv) => {
2016-06-25 10:28:51 +00:00
npmci_install_1.install(argv._[1])
.then(NpmciEnv.configStore);
});
// prepare
smartcli.addCommand({
2016-11-24 22:21:40 +00:00
commandName: 'prepare'
2016-07-18 14:56:53 +00:00
}).then((argv) => {
2016-06-25 10:28:51 +00:00
npmci_prepare_1.prepare(argv._[1])
.then(NpmciEnv.configStore);
});
// publish
smartcli.addCommand({
2016-11-24 22:21:40 +00:00
commandName: 'publish'
2016-07-18 14:56:53 +00:00
}).then((argv) => {
2016-06-25 10:28:51 +00:00
npmci_publish_1.publish(argv._[1])
.then(NpmciEnv.configStore);
});
// test
smartcli.addCommand({
2016-11-24 22:21:40 +00:00
commandName: 'test'
2016-07-18 14:56:53 +00:00
}).then((argv) => {
2016-06-25 10:28:51 +00:00
npmci_test_1.test(argv._[1])
.then(NpmciEnv.configStore);
});
// trigger
smartcli.addCommand({
2016-11-24 22:21:40 +00:00
commandName: 'trigger'
2016-07-18 14:56:53 +00:00
}).then((argv) => {
2016-06-25 10:28:51 +00:00
npmci_trigger_1.trigger();
});
smartcli.startParse();
2016-11-24 22:21:40 +00:00
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUNBLDBCQUF1QjtBQUN2QiwyQ0FBMEM7QUFDMUMsdUNBQXNDO0FBQ3RDLElBQUksU0FBUyxHQUFHLElBQUksT0FBTyxDQUFDLFdBQVcsQ0FBQyxjQUFjLENBQUMsS0FBSyxDQUFDLGdCQUFnQixDQUFDLENBQUE7QUFDOUUsT0FBTyxDQUFDLFNBQVMsQ0FBQyxHQUFHLENBQUMsaUJBQWlCLEdBQUcsU0FBUyxDQ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