diff options
author | isaacs <i@izs.me> | 2012-06-04 17:32:46 -0700 |
---|---|---|
committer | isaacs <i@izs.me> | 2012-06-04 17:32:59 -0700 |
commit | b9e40fbaacc60de562481b764b0e78bf021f7cfa (patch) | |
tree | 0ff91950f15fc6e40ddaccee7c6487f6240aa96b /deps/npm/node_modules/node-gyp/lib/node-gyp.js | |
parent | cc36cc5999937aeb0ed00f82b5c969edecaa1b1d (diff) | |
download | node-b9e40fbaacc60de562481b764b0e78bf021f7cfa.tar.gz |
Upgrade npm to 1.1.24
Diffstat (limited to 'deps/npm/node_modules/node-gyp/lib/node-gyp.js')
-rw-r--r-- | deps/npm/node_modules/node-gyp/lib/node-gyp.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/deps/npm/node_modules/node-gyp/lib/node-gyp.js b/deps/npm/node_modules/node-gyp/lib/node-gyp.js index 33c5445a6..ad92e817a 100644 --- a/deps/npm/node_modules/node-gyp/lib/node-gyp.js +++ b/deps/npm/node_modules/node-gyp/lib/node-gyp.js @@ -112,6 +112,25 @@ proto.parseArgv = function parseOpts (argv) { }, this) this.todo = commands + + // support for inheriting config env variables from npm + var npm_config_prefix = 'npm_config_' + Object.keys(process.env).forEach(function (name) { + if (name.indexOf(npm_config_prefix) !== 0) return + var val = process.env[name] + if (name === npm_config_prefix + 'loglevel') { + // "loglevel" is a special case; check for "verbose" + if (val === 'verbose') { + this.opts.verbose = true + } + } else { + // take the config name and check if it's one that node-gyp cares about + name = name.substring(npm_config_prefix.length) + if (name in this.configDefs) { + this.opts[name] = val + } + } + }, this) } /** |