Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Commit 5523951

Browse files
mattezellisaacs
authored andcommitted
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. Fix: #29 PR-URL: #30 Close: #30 Reviewed-by: @isaacs
1 parent ea18ed2 commit 5523951

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

index.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ let PATH = 'PATH'
2323
// windows calls it's path 'Path' usually, but this is not guaranteed.
2424
if (process.platform === 'win32') {
2525
PATH = 'Path'
26-
Object.keys(process.env).forEach(function (e) {
27-
if (e.match(/^PATH$/i)) {
28-
PATH = e
29-
}
30-
})
26+
if (!process.env[PATH]) {
27+
Object.keys(process.env).forEach(function (e) {
28+
if (e.match(/^PATH$/i)) {
29+
PATH = e
30+
}
31+
})
32+
}
3133
}
3234

3335
function logid (pkg, stage) {

0 commit comments

Comments
 (0)