From 36291f6a8f7431d11743d91f71e968ca587d3698 Mon Sep 17 00:00:00 2001 From: Joe Fitzgerald Date: Thu, 8 Sep 2016 11:18:28 -0600 Subject: [PATCH] Combine Check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The additional (!process.env[key] && envToAssign[key]) check allows “preserved” variables to be set for the first time if they are currently unset --- src/update-process-env.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/update-process-env.js b/src/update-process-env.js index fbae1c983..a2f1715f3 100644 --- a/src/update-process-env.js +++ b/src/update-process-env.js @@ -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] - } } }