File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -66,8 +66,14 @@ let configStr = argv._[0] || 'nodejs';
66
66
let configName = path . basename ( configStr ) ;
67
67
let remoteConfig = configName . indexOf ( ':' ) > - 1 ;
68
68
let configPath = path . dirname ( configStr ) ;
69
- if ( ! configPath || ( configPath === '.' ) ) configPath = path . resolve ( __dirname , 'configs' ) ;
70
- let configFile = path . join ( configPath , configName ) + '.json' ;
69
+ if ( ! configPath ) configPath = path . resolve ( __dirname , 'configs' ) ;
70
+ let configFile = path . join ( configPath , configName ) ;
71
+ if ( ! path . extname ( configFile ) ) {
72
+ configFile += '.json' ;
73
+ }
74
+ else {
75
+ configName = configName . replace ( path . extname ( configFile ) , '' ) ;
76
+ }
71
77
let config = remoteConfig ? { defaults : { } } : yaml . parse ( fs . readFileSync ( configFile , 'utf8' ) , { prettyErrors : true } ) ;
72
78
let defName = argv . _ [ 1 ] || path . resolve ( __dirname , 'defs/petstore3.json' ) ;
73
79
You can’t perform that action at this time.
0 commit comments