update to better smartcli parsing

This commit is contained in:
2018-05-04 15:58:11 +02:00
parent 362740a55f
commit 9e8fbac573
9 changed files with 134 additions and 182 deletions

View File

@ -76,7 +76,7 @@ let publish = async () => {
await bash(`yarn run build`);
plugins.beautylog.success(`Nice!!! The build for the publication was successfull!`);
plugins.beautylog.log(`Lets clean up so we don't publish any packages that don't belong to us:`)
plugins.beautylog.log(`Lets clean up so we don't publish any packages that don't belong to us:`);
// -> clean up before we publish stuff
await bash(`rm -r .yarn`);
await bash(`rm -r node_modules`);

View File

@ -11,112 +11,104 @@ import * as NpmciEnv from './npmci.env';
import * as npmciMods from './npmci.mods';
let smartcli = new plugins.smartcli.Smartcli();
smartcli.addVersion(npmciInfo.version);
const npmciSmartcli = new plugins.smartcli.Smartcli();
npmciSmartcli.addVersion(npmciInfo.version);
// clean
smartcli
npmciSmartcli
.addCommand('clean')
.then(async argv => {
.subscribe(async argv => {
let modClean = await npmciMods.modClean.load();
await modClean.clean();
})
.catch(err => {
}, err => {
console.log(err);
process.exit(1);
});
// cloudflare
smartcli
npmciSmartcli
.addCommand('cloudflare')
.then(async argvArg => {
.subscribe(async argvArg => {
let modPurge = await npmciMods.modCloudflare.load();
await modPurge.handleCli(argvArg);
})
.catch(err => {
}, err => {
console.log(err);
});
// command
smartcli
npmciSmartcli
.addCommand('command')
.then(async argv => {
.subscribe(async argv => {
let modCommand = await npmciMods.modCommand.load();
await modCommand.command();
})
.catch(err => {
}, err => {
console.log(err);
process.exit(1);
});
// command
smartcli
npmciSmartcli
.addCommand('git')
.then(async argvArg => {
.subscribe(async argvArg => {
let modGit = await npmciMods.modGit.load();
await modGit.handleCli(argvArg);
})
.catch(err => {
}, err => {
console.log(err);
process.exit(1);
});
// build
smartcli
npmciSmartcli
.addCommand('docker')
.then(async argvArg => {
.subscribe(async argvArg => {
let modDocker = await npmciMods.modDocker.load();
await modDocker.handleCli(argvArg);
})
.catch(err => {
}, err => {
console.log(err);
process.exit(1);
});
// node
smartcli
npmciSmartcli
.addCommand('node')
.then(async argvArg => {
.subscribe(async argvArg => {
let modNode = await npmciMods.modNode.load();
await modNode.handleCli(argvArg);
})
.catch(err => {
}, err => {
console.log(err);
process.exit(1);
});
// npm
smartcli
npmciSmartcli
.addCommand('npm')
.then(async argvArg => {
.subscribe(async argvArg => {
let modNpm = await npmciMods.modNpm.load();
await modNpm.handleCli(argvArg);
})
.catch(err => {
}, err => {
console.log(err);
});
// trigger
smartcli
npmciSmartcli
.addCommand('ssh')
.then(async argvArg => {
.subscribe(async argvArg => {
let modSsh = await npmciMods.modSsh.load();
await modSsh.handleCli(argvArg);
})
.catch(err => {
}, err => {
console.log(err);
process.exit(1);
});
// trigger
smartcli
npmciSmartcli
.addCommand('trigger')
.then(async argv => {
.subscribe(async argv => {
let modTrigger = await npmciMods.modTrigger.load();
await modTrigger.trigger();
})
.catch(err => {
}, err => {
console.log(err);
process.exit(1);
});
smartcli.startParse();
npmciSmartcli.startParse();

View File

@ -5,7 +5,7 @@ export import path = require('path');
export import projectinfo = require('projectinfo');
export import q = require('smartq');
export let request = require('request');
export import smartcli = require('smartcli');
export import smartcli = require('@pushrocks/smartcli');
export import smartdelay = require('smartdelay');
export import smartfile = require('smartfile');
export import shelljs = require('shelljs');