Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
167b4d29df | |||
02fec216db |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@pushrocks/smartcli",
|
||||
"version": "3.0.10",
|
||||
"version": "3.0.11",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@pushrocks/smartcli",
|
||||
"private": false,
|
||||
"version": "3.0.10",
|
||||
"version": "3.0.11",
|
||||
"description": "easy observable cli tasks",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
|
@ -27,7 +27,7 @@ export class Smartcli {
|
||||
commands;
|
||||
questions;
|
||||
version: string;
|
||||
private onlyOnProcessEnvCliCall = false;
|
||||
private checkForEnvCliCall = true;
|
||||
|
||||
/**
|
||||
* map of all Trigger/Observable objects to keep track
|
||||
@ -46,8 +46,8 @@ export class Smartcli {
|
||||
/**
|
||||
* halts any execution of commands if (process.env.CLI_CALL === false)
|
||||
*/
|
||||
onlyTriggerOnProcessEnvCliCall() {
|
||||
this.onlyOnProcessEnvCliCall = true;
|
||||
disableEnvCliCall() {
|
||||
this.checkForEnvCliCall = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -144,15 +144,7 @@ export class Smartcli {
|
||||
(this.argv._.length === 1 && this.argv._[0].startsWith('test/'))) &&
|
||||
!this.argv.v
|
||||
) {
|
||||
if (this.onlyOnProcessEnvCliCall) {
|
||||
if (process.env.CLI_CALL === 'true') {
|
||||
this.trigger('standardTask');
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
this.trigger('standardTask');
|
||||
}
|
||||
this.trigger('standardTask');
|
||||
}
|
||||
});
|
||||
return standardSubject;
|
||||
@ -162,6 +154,10 @@ export class Smartcli {
|
||||
* start the process of evaluating commands
|
||||
*/
|
||||
startParse(): void {
|
||||
if (!process.env.CLI_CALL && this.checkForEnvCliCall) {
|
||||
console.log(`note: @pushrocks/smartcli: You called .startParse() on a SmartCli instance. However process.env.CLI_CALL being absent prevented parsing.`);
|
||||
return;
|
||||
}
|
||||
this.argv = this.argv.argv;
|
||||
this.parseStarted.resolve();
|
||||
return;
|
||||
|
Reference in New Issue
Block a user