Combine Check

- The additional (!process.env[key] && envToAssign[key]) check allows “preserved” variables to be set for the first time if they are currently unset
This commit is contained in:
Joe Fitzgerald
2016-09-08 11:18:28 -06:00
parent 3c7a89ec93
commit 36291f6a8f

View File

@@ -31,12 +31,8 @@ function updateProcessEnv (launchEnv) {
}
for (let key in envToAssign) {
if (!ENVIRONMENT_VARIABLES_TO_PRESERVE.has(key)) {
if (!ENVIRONMENT_VARIABLES_TO_PRESERVE.has(key) || (!process.env[key] && envToAssign[key])) {
process.env[key] = envToAssign[key]
} else {
if (!process.env[key] && envToAssign[key]) {
process.env[key] = envToAssign[key]
}
}
}