diff --git a/electron/main.js b/electron/main.js index 95838d9e9b..1d3c231728 100644 --- a/electron/main.js +++ b/electron/main.js @@ -88,7 +88,7 @@ function getPreferredEnvFilePath(env = process.env) { candidates.push(path.join(path.resolve(env.DATA_DIR.trim()), ".env")); } - candidates.push(path.join(resolveDataDir(), ".env")); + candidates.push(path.join(resolveDataDir(null, env), ".env")); candidates.push(path.join(process.cwd(), ".env")); return candidates.find((filePath) => fs.existsSync(filePath)) || null; diff --git a/scripts/bootstrap-env.mjs b/scripts/bootstrap-env.mjs index a3c1c6fbaa..de8bfa790d 100644 --- a/scripts/bootstrap-env.mjs +++ b/scripts/bootstrap-env.mjs @@ -58,7 +58,7 @@ function getPreferredEnvFilePath(env = process.env) { candidates.push(join(resolve(env.DATA_DIR.trim()), ".env")); } - candidates.push(join(resolveDataDir(), ".env")); + candidates.push(join(resolveDataDir(null, env), ".env")); candidates.push(join(process.cwd(), ".env")); return candidates.find((filePath) => existsSync(filePath)) ?? null;