Skip to content

Commit

Permalink
Fix: env var names are case-insensitive in windows (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored Nov 27, 2020
1 parent c70860f commit 86af6a8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/shell-ops.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,15 @@ module.exports = {
*/
getModifiedEnv(platform = process.platform, defaultEnv = process.env) {
const env = {},
pathSeparator = platform === "win32" ? ";" : ":";
isWindows = platform === "win32",
pathSeparator = isWindows ? ";" : ":";

Object.keys(defaultEnv).forEach(key => {
env[key] = defaultEnv[key];

// environmental variable names are case-insensitive in windows
const compatKey = isWindows ? key.toUpperCase() : key;

env[compatKey] = defaultEnv[key];
});

// modify PATH to use local node_modules
Expand Down

0 comments on commit 86af6a8

Please sign in to comment.