npmci/dist/npmci.cli.js

118 lines
8.0 KiB
JavaScript

"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");
const npmciMonitor = require("./npmci.monitor");
npmciMonitor.run();
// Get Info about npmci itself
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);
});
// 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);
});
// command
smartcli
.addCommand('command')
.then((argv) => __awaiter(this, void 0, void 0, function* () {
let modCommand = yield npmciMods.modCommand.load();
yield modCommand.command();
}))
.catch(err => {
console.log(err);
process.exit(1);
});
// 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);
});
// build
smartcli
.addCommand('docker')
.then((argvArg) => __awaiter(this, void 0, void 0, function* () {
let modDocker = yield npmciMods.modDocker.load();
yield modDocker.handleCli(argvArg);
}))
.catch(err => {
console.log(err);
process.exit(1);
});
// node
smartcli
.addCommand('node')
.then((argvArg) => __awaiter(this, void 0, void 0, function* () {
let modNode = yield npmciMods.modNode.load();
yield modNode.handleCli(argvArg);
}))
.catch(err => {
console.log(err);
});
// npm
smartcli
.addCommand('npm')
.then((argvArg) => __awaiter(this, void 0, void 0, function* () {
let modNpm = yield npmciMods.modNpm.load();
yield modNpm.handleCli(argvArg);
}))
.catch(err => {
console.log(err);
});
// trigger
smartcli
.addCommand('ssh')
.then((argvArg) => __awaiter(this, void 0, void 0, function* () {
let modSsh = yield npmciMods.modSsh.load();
yield modSsh.handleCli(argvArg);
}))
.catch(err => {
console.log(err);
process.exit(1);
});
// trigger
smartcli
.addCommand('trigger')
.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);
});
smartcli.startParse();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuY2xpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvbnBtY2kuY2xpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7QUFBQSwyQ0FBMkM7QUFDM0MsdUNBQXVDO0FBQ3ZDLGdEQUFnRDtBQUNoRCxZQUFZLENBQUMsR0FBRyxFQUFFLENBQUM7QUFFbkIsOEJBQThCO0FBQzlCLElBQUksU0FBUyxHQUFHLElBQUksT0FBTyxDQUFDLFdBQVcsQ0FBQyxjQUFjLENBQUMsS0FBSyxDQUFDLGdCQUFnQixDQUFDLENBQUM7QUFDL0UsT0FBTyxDQUFDLFNBQVMsQ0FBQyxHQUFHLENBQUMsaUJBQWlCLEdBQUcsU0FBUyxDQUFDLE9BQU8sQ0FBQyxDQUFDO0FBSTdELDBDQUEwQztBQUUxQyxJQUFJLFFBQVEsR0FBRyxJQUFJLE9BQ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