This repository was archived by the owner on Aug 22, 2023. It is now read-only.
File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import {convertToCached, ConvertToCachedOptions} from './cache'
8
8
import deps from './deps'
9
9
import * as flags from './flags'
10
10
11
- export type CommandRunFn = < T extends Command > ( this : ICommandClass < T > , argv ?: string [ ] , opts ?: Config . IConfig | Config . ICommandOptions ) => Promise < void >
11
+ export type CommandRunFn = < T extends Command > ( this : ICommandClass < T > , argv ?: string [ ] , opts ?: Config . ICommandOptions ) => Promise < void >
12
12
13
13
export interface ICommandClass < T extends Command > {
14
14
run : CommandRunFn
@@ -38,11 +38,11 @@ export default abstract class Command {
38
38
/**
39
39
* instantiate and run the command
40
40
*/
41
- static run : CommandRunFn = async function ( argv : string [ ] = process . argv . slice ( 2 ) , opts : Config . IConfig | Config . ICommandOptions = { } ) {
41
+ static run : CommandRunFn = async function ( argv : string [ ] = process . argv . slice ( 2 ) , opts : Config . ICommandOptions = { } ) {
42
42
let cmd ! : Command
43
43
try {
44
44
let config
45
- if ( Config . isIConfig ( opts ) ) config = opts
45
+ if ( opts . config && Config . isIConfig ( opts . config ) ) config = opts . config
46
46
else config = await Config . read ( { root : opts . root || parentModule ! } )
47
47
cmd = new this ( argv , config )
48
48
return await cmd . run ( )
You can’t perform that action at this time.
0 commit comments