From 35548467040ba24365eac534747a7e1e52da0d4b Mon Sep 17 00:00:00 2001 From: Matt Ezell Date: Thu, 18 Apr 2019 14:29:39 -0500 Subject: [PATCH] feat(process.env.path): Use platform specific path casing if present Assume proper win32 path casing - only seek out alternative casing if win32 OS specific casing not present. --- index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 4eb8325..4ac6a75 100644 --- a/index.js +++ b/index.js @@ -23,11 +23,13 @@ let PATH = 'PATH' // windows calls it's path 'Path' usually, but this is not guaranteed. if (process.platform === 'win32') { PATH = 'Path' - Object.keys(process.env).forEach(function (e) { - if (e.match(/^PATH$/i)) { - PATH = e - } - }) + if (!process.env[PATH]) { + Object.keys(process.env).forEach(function (e) { + if (e.match(/^PATH$/i)) { + PATH = e + } + }) + } } function logid (pkg, stage) {