@rizzlesauce/oclif-command
Advanced tools
Comparing version 1.5.20-rossa.5 to 1.5.20-rossa.6
@@ -0,1 +1,5 @@ | ||
## [1.5.20-rossa.6](https://github.com/rizzlesauce/oclif-command/compare/v1.5.20-rossa.5...v1.5.20-rossa.6) (2020-03-16) | ||
## [1.5.20-rossa.5](https://github.com/rizzlesauce/oclif-command/compare/v1.5.20-rossa.4...v1.5.20-rossa.5) (2020-03-14) | ||
@@ -2,0 +6,0 @@ |
@@ -11,2 +11,3 @@ import * as Config from '@rizzlesauce/oclif-config'; | ||
config: Config.IConfig; | ||
options?: Config.Command.RunOptions | undefined; | ||
static _base: string; | ||
@@ -45,4 +46,5 @@ /** A command ID, used mostly in error or verbose reporting */ | ||
protected debug: (...args: any[]) => void; | ||
constructor(argv: string[], config: Config.IConfig); | ||
constructor(argv: string[], config: Config.IConfig, options?: Config.Command.RunOptions | undefined); | ||
readonly ctor: typeof Command; | ||
readonly isBeingRunByDefault: boolean; | ||
_run<T>(): Promise<T | undefined>; | ||
@@ -49,0 +51,0 @@ exit(code?: number): never; |
@@ -24,5 +24,6 @@ "use strict"; | ||
class Command { | ||
constructor(argv, config) { | ||
constructor(argv, config, options) { | ||
this.argv = argv; | ||
this.config = config; | ||
this.options = options; | ||
this.id = this.ctor.id; | ||
@@ -39,2 +40,5 @@ try { | ||
} | ||
get isBeingRunByDefault() { | ||
return !!this.options && !!this.options.isBeingRunByDefault; | ||
} | ||
async _run() { | ||
@@ -178,9 +182,9 @@ let err; | ||
*/ | ||
Command.run = async function (argv, opts) { | ||
Command.run = async function (argv, opts, runOptions) { | ||
if (!argv) | ||
argv = process.argv.slice(2); | ||
const config = await Config.load(opts || module.parent && module.parent.parent && module.parent.parent.filename || __dirname); | ||
let cmd = new this(argv, config); | ||
return cmd._run(argv); | ||
let cmd = new this(argv, config, runOptions); | ||
return cmd._run(argv, runOptions); | ||
}; | ||
exports.default = Command; |
@@ -31,3 +31,3 @@ "use strict"; | ||
_runDefaultCommand() { | ||
return this.config.runCommand(this._defaultCommandId || '', [...this.argv], { isRunByDefault: true }); | ||
return this.config.runCommand(this._defaultCommandId || '', [...this.argv], { isBeingRunByDefault: true }); | ||
} | ||
@@ -34,0 +34,0 @@ get _helpAliases() { |
{ | ||
"name": "@rizzlesauce/oclif-command", | ||
"description": "oclif base command", | ||
"version": "1.5.20-rossa.5", | ||
"version": "1.5.20-rossa.6", | ||
"author": "Jeff Dickey @jdxcode", | ||
@@ -9,3 +9,3 @@ "bugs": "https://github.com/rizzlesauce/oclif-command/issues", | ||
"@oclif/plugin-help": "^2", | ||
"@rizzlesauce/oclif-config": "^1.13.4-rossa.2", | ||
"@rizzlesauce/oclif-config": "^1.13.4-rossa.4", | ||
"@rizzlesauce/oclif-errors": "^1.2.2-beta.1", | ||
@@ -12,0 +12,0 @@ "@rizzlesauce/oclif-parser": "^3.8.5-rossa.1", |
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
59079
518