Skip to content

Commit 86af6a8

Browse files
authoredNov 27, 2020
Fix: env var names are case-insensitive in windows (#48)
1 parent c70860f commit 86af6a8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed
 

‎lib/shell-ops.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,15 @@ module.exports = {
3030
*/
3131
getModifiedEnv(platform = process.platform, defaultEnv = process.env) {
3232
const env = {},
33-
pathSeparator = platform === "win32" ? ";" : ":";
33+
isWindows = platform === "win32",
34+
pathSeparator = isWindows ? ";" : ":";
3435

3536
Object.keys(defaultEnv).forEach(key => {
36-
env[key] = defaultEnv[key];
37+
38+
// environmental variable names are case-insensitive in windows
39+
const compatKey = isWindows ? key.toUpperCase() : key;
40+
41+
env[compatKey] = defaultEnv[key];
3742
});
3843

3944
// modify PATH to use local node_modules

0 commit comments

Comments
 (0)
Please sign in to comment.