Skip to content

Commit

Permalink
Release 2.4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
imfly committed Aug 2, 2024
1 parent adf2ede commit 3d647a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ddn/core",
"version": "2.4.7",
"version": "2.4.8",
"description": "DDN core.",
"main": "./dist/index.js",
"types": "dist/index.d.ts",
Expand Down
13 changes: 5 additions & 8 deletions packages/core/src/getUserConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,16 @@ export function getConfigFile (cwd) {
export function getConstantsFile (cwd) {
const files = process.env.CONSTANTS_FILE
? process.env.CONSTANTS_FILE.split(',').filter(v => v && v.trim())
: ['constants.ts', 'constants.js', 'config/constants.ts', 'config/constants.js']
: ['config/constants.ts', 'config/constants.js', 'constants.ts', 'constants.js']

// const validFiles = files.filter(f => {})
const validFiles = files.filter(f => existsSync(join(cwd, f)))

// assert(
// validFiles.length <= 1,
// `Multiple config files (${validFiles.join(', ')}) were detected, please keep only one.`
// )
assert(
validFiles.length <= 1,
`Multiple config files (${validFiles.join(', ')}) were detected, please keep only one.`
)

if (validFiles.length <= 1) {
throw Error(`Multiple config files (${validFiles.join(', ')}) were detected, please keep only one.`)
}
if (validFiles[0]) {
return winPath(join(cwd, validFiles[0]))
}
Expand Down

0 comments on commit 3d647a1

Please sign in to comment.