mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-07 03:24:53 +10:00
fix: rethrow non-ENOENT errors when loading .env
This commit is contained in:
Vendored
+4
-4
@@ -7,11 +7,11 @@ const workspaceRoot = findWorkspaceRoot();
|
||||
|
||||
if (workspaceRoot) {
|
||||
try {
|
||||
// ponytail: native stand-in for dotenv. loadEnvFile throws when .env is absent
|
||||
// (e.g. production with injected env), and existing process.env still wins — so just tolerate a miss.
|
||||
// Native stand-in for dotenv: existing process.env still wins over file values.
|
||||
process.loadEnvFile(join(workspaceRoot, ".env"));
|
||||
} catch {
|
||||
// no .env file — rely on the ambient process environment
|
||||
} catch (error) {
|
||||
// A missing .env is expected (e.g. production with injected env); anything else is a real problem.
|
||||
if (!(error instanceof Error && "code" in error && error.code === "ENOENT")) throw error;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user