improve cli creds extraction

This commit is contained in:
dswbx
2025-03-28 18:03:09 +01:00
parent 9e3c081e50
commit 11a28eba88
4 changed files with 35 additions and 28 deletions

View File

@@ -72,9 +72,10 @@ export async function getConfigPath(filePath?: string) {
}
}
const paths = ["./bknd.config", "./bknd.config.ts", "./bknd.config.js"];
const exts = ["", ".js", ".ts", ".mjs", ".cjs", ".json"];
const paths = exts.map((e) => `bknd.config${e}`);
for (const p of paths) {
const _p = path.resolve(process.cwd(), p);
const _p = path.relative(process.cwd(), p);
if (await fileExists(_p)) {
return _p;
}