Comparing version 1.1.11 to 1.1.12
@@ -5,9 +5,10 @@ import { Base, IBaseOptions } from '../base'; | ||
action: string; | ||
status?: string; | ||
status: string | undefined; | ||
active: boolean; | ||
} | ||
export declare class ActionBase extends Base { | ||
protected task: ITask; | ||
start(action: string, status?: string): void; | ||
stop(msg?: string): void; | ||
private readonly globals; | ||
task: ITask | undefined; | ||
readonly running: boolean; | ||
@@ -14,0 +15,0 @@ status: string | undefined; |
@@ -24,3 +24,3 @@ "use strict"; | ||
start(action, status) { | ||
const task = (this.task = { action, status, active: this.task && this.task.active }); | ||
const task = (this.task = { action, status, active: !!(this.task && this.task.active) }); | ||
this._start(); | ||
@@ -41,2 +41,13 @@ task.active = true; | ||
} | ||
get globals() { | ||
const globals = (global['cli-ux'] = global['cli-ux'] || {}); | ||
globals.action = globals.action || {}; | ||
return globals; | ||
} | ||
get task() { | ||
return this.globals.action.task; | ||
} | ||
set task(task) { | ||
this.globals.action.task = task; | ||
} | ||
get running() { | ||
@@ -43,0 +54,0 @@ return !!this.task; |
@@ -8,5 +8,10 @@ "use strict"; | ||
this.options = options; | ||
this.stdout = new deps_1.deps.StreamOutput(this.options.mock ? undefined : process.stdout); | ||
this.stderr = new deps_1.deps.StreamOutput(this.options.mock ? undefined : process.stderr); | ||
if (this.options.mock) | ||
const globalOptions = global['cli-ux'] || {}; | ||
if (options.mock === undefined) | ||
options.mock = globalOptions.mock; | ||
if (options.debug === undefined) | ||
options.debug = globalOptions.debug; | ||
this.stdout = new deps_1.deps.StreamOutput(options.mock ? undefined : process.stdout); | ||
this.stderr = new deps_1.deps.StreamOutput(options.mock ? undefined : process.stderr); | ||
if (options.mock) | ||
deps_1.deps.chalk.enabled = false; | ||
@@ -13,0 +18,0 @@ } |
{ | ||
"name": "cli-ux", | ||
"description": "set of CLI output utilities", | ||
"version": "1.1.11", | ||
"version": "1.1.12", | ||
"author": "Jeff Dickey", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/jdxcode/cli-ux/issues", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48650
1463