Skip to content

Commit

Permalink
bugfix: 修复 config.json 文件未找到的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wangliang181230 committed Jan 16, 2025
1 parent 8ecc120 commit af091f2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/core/src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,14 @@ function _getConfigPath () {
// 兼容1.7.3及以下版本的配置文件处理逻辑
const newFilePath = path.join(dir, '/config.json')
const oldFilePath = path.join(dir, '/config.json5')
if (!fs.existsSync(newFilePath) && fs.existsSync(oldFilePath)) {
return oldFilePath // 如果新文件不存在,且旧文件存在,则返回旧文件路径
if (!fs.existsSync(newFilePath)) {
if (fs.existsSync(oldFilePath)) {
return oldFilePath // 如果新文件不存在,且旧文件存在,则返回旧文件路径
} else {
return null // 两个文件都不存在
}
}

return newFilePath
}

Expand Down

0 comments on commit af091f2

Please sign in to comment.