npmci/dist/npmci.cli.js

100 lines
7.9 KiB
JavaScript
Raw Normal View History

2017-05-18 20:40:09 +00:00
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const plugins = require("./npmci.plugins");
const paths = require("./npmci.paths");
let npmciInfo = new plugins.projectinfo.ProjectinfoNpm(paths.NpmciPackageRoot);
plugins.beautylog.log('npmci version: ' + npmciInfo.version);
const NpmciEnv = require("./npmci.env");
const npmciMods = require("./npmci.mods");
let smartcli = new plugins.smartcli.Smartcli();
smartcli.addVersion(npmciInfo.version);
// build
smartcli.addCommand('build')
.then((argv) => __awaiter(this, void 0, void 0, function* () {
let modBuild = yield npmciMods.modBuild.load();
yield modBuild.build(argv._[1]);
NpmciEnv.configStore();
})).catch(err => {
console.log(err);
process.exit(1);
});
// clean
smartcli.addCommand('clean')
.then((argv) => __awaiter(this, void 0, void 0, function* () {
let modClean = yield npmciMods.modClean.load();
yield modClean.clean();
2017-05-19 10:09:33 +00:00
yield NpmciEnv.configStore();
2017-05-18 20:40:09 +00:00
})).catch(err => {
console.log(err);
process.exit(1);
});
// command
smartcli.addCommand('command')
.then((argv) => __awaiter(this, void 0, void 0, function* () {
let modCommand = yield npmciMods.modCommand.load();
2017-05-19 10:09:33 +00:00
yield modCommand.command();
2017-05-18 20:40:09 +00:00
yield NpmciEnv.configStore();
})).catch(err => {
console.log(err);
process.exit(1);
});
// install
smartcli.addCommand('install')
2017-05-19 10:09:33 +00:00
.then((argv) => __awaiter(this, void 0, void 0, function* () {
let modInstall = yield npmciMods.modInstall.load();
yield modInstall.install(argv._[1]);
yield NpmciEnv.configStore();
})).catch(err => {
console.log(err);
process.exit(1);
2017-05-18 20:40:09 +00:00
});
// prepare
smartcli.addCommand('prepare')
2017-05-19 10:09:33 +00:00
.then((argv) => __awaiter(this, void 0, void 0, function* () {
let modPrepare = yield npmciMods.modPrepare.load();
yield modPrepare.prepare(argv._[1]);
yield NpmciEnv.configStore();
})).catch(err => {
console.log(err);
process.exit(1);
2017-05-18 20:40:09 +00:00
});
// publish
smartcli.addCommand('publish')
2017-05-19 10:09:33 +00:00
.then((argv) => __awaiter(this, void 0, void 0, function* () {
let modPublish = yield npmciMods.modPublish.load();
yield modPublish.publish(argv._[1]);
yield NpmciEnv.configStore();
})).catch(err => {
console.log(err);
process.exit(1);
2017-05-18 20:40:09 +00:00
});
// test
smartcli.addCommand('test')
2017-05-19 10:09:33 +00:00
.then((argv) => __awaiter(this, void 0, void 0, function* () {
let modTest = yield npmciMods.modTest.load();
yield modTest.test(argv._[1]);
yield NpmciEnv.configStore();
})).catch(err => {
console.log(err);
process.exit(1);
2017-05-18 20:40:09 +00:00
});
// trigger
smartcli.addCommand('trigger')
2017-05-19 10:09:33 +00:00
.then((argv) => __awaiter(this, void 0, void 0, function* () {
let modTrigger = yield npmciMods.modTrigger.load();
yield modTrigger.trigger();
yield NpmciEnv.configStore();
})).catch(err => {
console.log(err);
process.exit(1);
2017-05-18 20:40:09 +00:00
});
smartcli.startParse();
2017-05-19 10:09:33 +00:00
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuY2xpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbnBtY2kuY2xpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSwyQ0FBMEM7QUFDMUMsdUNBQXNDO0FBQ3RDLElBQUksU0FBUyxHQUFHLElBQUksT0FBTyxDQUFDLFdBQVcsQ0FBQyxjQUFjLENBQUMsS0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