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

Commit

Permalink
feat(process.env.path): Use platform specific path casing if present
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mattezell authored and isaacs committed Jul 17, 2019
1 parent ea18ed2 commit 5523951
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions index.js
Expand Up @@ -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) {
Expand Down

0 comments on commit 5523951

Please sign in to comment.