Skip to content

Commit 1920577

Browse files
committed
build: fix lint error
1 parent d6d58f0 commit 1920577

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cg.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ if ((configPath === '.') && (!configStr.startsWith('.'))) {
7171
}
7272
if (!configPath) configPath = path.resolve(__dirname,'configs');
7373
let configFile = path.join(configPath,configName);
74-
if (!path.extname(configFile)) {
75-
configFile += '.json';
74+
if (path.extname(configFile)) {
75+
configName = configName.replace(path.extname(configFile),'');
7676
}
7777
else {
78-
configName = configName.replace(path.extname(configFile),'');
78+
configFile += '.json';
7979
}
8080
let config = remoteConfig ? { defaults: {} } : yaml.parse(fs.readFileSync(configFile,'utf8'), {prettyErrors: true});
8181
let defName = argv._[1] || path.resolve(__dirname,'defs/petstore3.json');

0 commit comments

Comments
 (0)