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");
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-10-09 16:10:01 +00:00
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIj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