@@ -3,7 +3,7 @@ import split from 'lodash/split';
33import replace from 'lodash/replace' ;
44import { Command , Interfaces , toStandardizedId } from '@oclif/core' ;
55
6- import { loadConfig } from './load-config' ;
6+ import { loadConfig , LoadConfigOptions } from './load-config' ;
77
88const castArray = < T > ( input ?: T | T [ ] ) : T [ ] => {
99 if ( input === undefined ) return [ ] ;
@@ -13,16 +13,16 @@ const castArray = <T>(input?: T | T[]): T[] => {
1313export function command (
1414 commandInstance : Command . Class ,
1515 args : string [ ] | string ,
16- opts : loadConfig . Options = { } ,
16+ opts : LoadConfigOptions = { } ,
1717) : {
1818 run ( ctx : { config : Interfaces . Config ; expectation : string } ) : Promise < void > ;
1919} {
2020 return {
2121 async run ( ctx : { config : Interfaces . Config ; expectation : string } ) {
22- if ( ! ctx . config || opts . reset ) ctx . config = await loadConfig ( opts ) . run ( { } as any ) ;
22+ if ( ! ctx . config || opts . reset ) ctx . config = await loadConfig ( opts ) . run ( { } ) ;
2323 args = castArray ( args ) ;
24- const firstExample : string = '' + first ( commandInstance . examples ) ;
25- const [ id ] = split ( replace ( firstExample , '$ csdx ' , '' ) , ' ' ) ;
24+ const exampleText = String ( first ( commandInstance . examples ) ) ;
25+ const [ id ] = split ( replace ( exampleText , '$ csdx ' , '' ) , ' ' ) ;
2626 const cmdId = toStandardizedId ( id , ctx . config ) ;
2727 ctx . expectation = ctx . expectation || `runs ${ args . join ( ' ' ) } ` ;
2828 await ctx . config . runHook ( 'init' , { id : cmdId , argv : args } ) ;
0 commit comments