npmci/dist/npmci.cli.js

118 lines
8.0 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");
2017-09-08 21:16:09 +00:00
const npmciMonitor = require("./npmci.monitor");
npmciMonitor.run();
2017-09-08 12:58:44 +00:00
// Get Info about npmci itself
2017-05-18 20:40:09 +00:00
let npmciInfo = new plugins.projectinfo.ProjectinfoNpm(paths.NpmciPackageRoot);
plugins.beautylog.log('npmci version: ' + npmciInfo.version);
const npmciMods = require("./npmci.mods");
let smartcli = new plugins.smartcli.Smartcli();
smartcli.addVersion(npmciInfo.version);
// clean
2018-04-04 20:25:13 +00:00
smartcli
.addCommand('clean')
2017-05-18 20:40:09 +00:00
.then((argv) => __awaiter(this, void 0, void 0, function* () {
let modClean = yield npmciMods.modClean.load();
yield modClean.clean();
2018-04-04 20:25:13 +00:00
}))
.catch(err => {
2017-05-18 20:40:09 +00:00
console.log(err);
process.exit(1);
});
2017-08-27 13:24:17 +00:00
// cloudflare
2018-04-04 20:25:13 +00:00
smartcli
.addCommand('cloudflare')
2017-08-27 13:24:17 +00:00
.then((argvArg) => __awaiter(this, void 0, void 0, function* () {
let modPurge = yield npmciMods.modCloudflare.load();
yield modPurge.handleCli(argvArg);
2018-04-04 20:25:13 +00:00
}))
.catch(err => {
2017-08-27 13:24:17 +00:00
console.log(err);
});
2017-05-18 20:40:09 +00:00
// command
2018-04-04 20:25:13 +00:00
smartcli
.addCommand('command')
2017-05-18 20:40:09 +00:00
.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();
2018-04-04 20:25:13 +00:00
}))
.catch(err => {
2017-05-18 20:40:09 +00:00
console.log(err);
process.exit(1);
});
2017-09-08 12:58:44 +00:00
// command
2018-04-04 20:25:13 +00:00
smartcli
.addCommand('git')
2017-09-08 12:58:44 +00:00
.then((argvArg) => __awaiter(this, void 0, void 0, function* () {
let modGit = yield npmciMods.modGit.load();
yield modGit.handleCli(argvArg);
2018-04-04 20:25:13 +00:00
}))
.catch(err => {
2017-09-08 12:58:44 +00:00
console.log(err);
process.exit(1);
});
2017-08-27 13:24:17 +00:00
// build
2018-04-04 20:25:13 +00:00
smartcli
.addCommand('docker')
2017-06-07 13:16:33 +00:00
.then((argvArg) => __awaiter(this, void 0, void 0, function* () {
2017-08-27 13:24:17 +00:00
let modDocker = yield npmciMods.modDocker.load();
yield modDocker.handleCli(argvArg);
2018-04-04 20:25:13 +00:00
}))
.catch(err => {
2017-05-19 10:09:33 +00:00
console.log(err);
process.exit(1);
2017-05-18 20:40:09 +00:00
});
2017-08-27 13:24:17 +00:00
// node
2018-04-04 20:25:13 +00:00
smartcli
.addCommand('node')
2017-07-27 13:27:25 +00:00
.then((argvArg) => __awaiter(this, void 0, void 0, function* () {
2017-08-27 13:24:17 +00:00
let modNode = yield npmciMods.modNode.load();
yield modNode.handleCli(argvArg);
2018-04-04 20:25:13 +00:00
}))
.catch(err => {
2017-05-19 10:09:33 +00:00
console.log(err);
2017-05-18 20:40:09 +00:00
});
2017-08-27 13:24:17 +00:00
// npm
2018-04-04 20:25:13 +00:00
smartcli
.addCommand('npm')
.then((argvArg) => __awaiter(this, void 0, void 0, function* () {
2017-08-27 13:24:17 +00:00
let modNpm = yield npmciMods.modNpm.load();
yield modNpm.handleCli(argvArg);
2018-04-04 20:25:13 +00:00
}))
.catch(err => {
2017-05-19 10:09:33 +00:00
console.log(err);
2017-05-18 20:40:09 +00:00
});
2017-08-27 13:24:17 +00:00
// trigger
2018-04-04 20:25:13 +00:00
smartcli
.addCommand('ssh')
2017-08-27 13:24:17 +00:00
.then((argvArg) => __awaiter(this, void 0, void 0, function* () {
let modSsh = yield npmciMods.modSsh.load();
yield modSsh.handleCli(argvArg);
2018-04-04 20:25:13 +00:00
}))
.catch(err => {
2017-05-19 10:09:33 +00:00
console.log(err);
process.exit(1);
2017-05-18 20:40:09 +00:00
});
// trigger
2018-04-04 20:25:13 +00:00
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();
2018-04-04 20:25:13 +00:00
}))
.catch(err => {
2017-05-19 10:09:33 +00:00
console.log(err);
process.exit(1);
2017-05-18 20:40:09 +00:00
});
smartcli.startParse();
2018-04-04 20:25:13 +00:00
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuY2xpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbnBtY2kuY2xpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSwyQ0FBMkM7QUFDM0MsdUNBQXVDO0FBQ3ZDLGdEQUFnRDtBQUNoRCxZQUFZLENBQUMsR0FBRyxFQUFFLENBQUM7QUFFbkIsOEJBQThCO0FBQzlCLElBQUksU0FBUyxHQUFHLElBQUksT0FBTyxDQUFDLFdBQVcsQ0FBQyxjQUFjLENBQUMsS0FBSyxDQUFDLGdCQUFnQixDQUFDLENBQUM7QUFDL0UsT0FBTyxDQUFDLFNBQVMsQ0FBQyxHQUFHLENBQUMsaUJBQWlCLEdBQUcsU0FBUyxDQUFDLE9BQU8sQ0FBQyxDQUFDO0FBSTdELDBDQUEwQztBQUUxQyxJQUFJLFFBQVEsR0FBRyxJQUFJLE9BQU8sQ0F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