diff options
author | isaacs <i@izs.me> | 2010-05-11 09:40:54 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2010-05-11 09:40:54 +0400 |
commit | 821ca215085300d7297029794bb1b8852d749959 (patch) | |
tree | e5344feccb788849a60801b1300b155dd04b1869 /lib | |
parent | 9c5c26450031bb8806e23115da826d9a866d128e (diff) |
Expose config settings to lifecycle scripts.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils/lifecycle.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/utils/lifecycle.js b/lib/utils/lifecycle.js index 69f45c9ec..234555d7f 100644 --- a/lib/utils/lifecycle.js +++ b/lib/utils/lifecycle.js @@ -53,11 +53,18 @@ function makeEnv (data, prefix, env) { for (var i in data) if (i.charAt(0) !== "_") { if (data[i] && typeof(data[i]) === "object") { + env[prefix+i] = JSON.stringify(data[i]) makeEnv(data[i], prefix+i+"_", env) } else { env[prefix+i] = String(data[i]) } } + if (prefix !== "npm_package_") return env + prefix = "npm_config_" + var conf = npm.config.get() + for (var i in conf) if (i.charAt(0) !== "_" && i !== "auth") { + env[prefix+i] = String(conf[i]) + } return env } |