Skip to content

Commit

Permalink
NPM_CONFIG environment variable can technically have a hyphen
Browse files Browse the repository at this point in the history
  • Loading branch information
deepy committed Dec 14, 2021
1 parent 90b574a commit 9418c44
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/kotlin/com/github/gradle/node/npm/proxy/NpmProxy.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ class NpmProxy {

// And since npm also takes settings in the form of environment variables with the
// NPM_CONFIG_<setting> format, we should check those. Hopefully nobody does this.
// Windows will let you set environment variables with hyphens in them, but shells
// on Linux will fight you so you'll have to be sneaky, adding both here "just in case".
private val npmProxyVariables = listOf(
"NPM_CONFIG_PROXY", "NPM_CONFIG_HTTPS-PROXY", "NPM_CONFIG_NOPROXY"
"NPM_CONFIG_PROXY", "NPM_CONFIG_HTTPS-PROXY", "NPM_CONFIG_HTTPS_PROXY", "NPM_CONFIG_NOPROXY"
)

fun computeNpmProxyEnvironmentVariables(): Map<String, String> {
Expand Down

0 comments on commit 9418c44

Please sign in to comment.