fix: js/py dotenv unexpectedly overrides existing env vars (#113)
This commit is contained in:
@@ -75,7 +75,10 @@ async function loadEnv(filePath) {
|
||||
if (line.trim().startsWith("#") || line.trim() === "") return;
|
||||
|
||||
const [key, ...value] = line.split("=");
|
||||
process.env[key.trim()] = value.join("=").trim();
|
||||
const envName = key.trim();
|
||||
if (!process.env[envName]) {
|
||||
process.env[envName] = value.join("=").trim();
|
||||
}
|
||||
});
|
||||
} catch { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user