npmci/dist/npmci.cli.js

100 lines
7.6 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
smartcli.addCommand('clean')
.then((argv) => __awaiter(this, void 0, void 0, function* () {
let modClean = yield npmciMods.modClean.load();
yield modClean.clean();
})).catch(err => {
console.log(err);
process.exit(1);
});
2017-08-27 13:24:17 +00:00
// cloudflare
smartcli.addCommand('cloudflare')
.then((argvArg) => __awaiter(this, void 0, void 0, function* () {
let modPurge = yield npmciMods.modCloudflare.load();
yield modPurge.handleCli(argvArg);
})).catch(err => {
console.log(err);
});
2017-05-18 20:40:09 +00:00
// 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
})).catch(err => {
console.log(err);
process.exit(1);
});
2017-09-08 12:58:44 +00:00
// command
smartcli.addCommand('git')
.then((argvArg) => __awaiter(this, void 0, void 0, function* () {
let modGit = yield npmciMods.modGit.load();
yield modGit.handleCli(argvArg);
})).catch(err => {
console.log(err);
process.exit(1);
});
2017-08-27 13:24:17 +00:00
// build
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);
2017-05-19 10:09:33 +00:00
})).catch(err => {
console.log(err);
process.exit(1);
2017-05-18 20:40:09 +00:00
});
2017-08-27 13:24:17 +00:00
// node
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);
2017-05-19 10:09:33 +00:00
})).catch(err => {
console.log(err);
2017-05-18 20:40:09 +00:00
});
2017-08-27 13:24:17 +00:00
// npm
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);
2017-05-19 10:09:33 +00:00
})).catch(err => {
console.log(err);
2017-05-18 20:40:09 +00:00
});
2017-08-27 13:24:17 +00:00
// trigger
smartcli.addCommand('ssh')
.then((argvArg) => __awaiter(this, void 0, void 0, function* () {
let modSsh = yield npmciMods.modSsh.load();
yield modSsh.handleCli(argvArg);
2017-05-19 10:09:33 +00:00
})).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();
})).catch(err => {
console.log(err);
process.exit(1);
2017-05-18 20:40:09 +00:00
});
smartcli.startParse();
2017-09-08 21:16:09 +00:00
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIj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