diff options
author | MichaelQQ <mingsian.tu@vpon.com> | 2016-04-14 12:28:30 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2017-07-18 04:09:21 +0300 |
commit | 20c46228d8f9243910f8c343f4830d52455d754e (patch) | |
tree | 24fb1c04e64b236bcc319bb704516ebddf00e842 /lib/utils/lifecycle.js | |
parent | b019680db78ae0a6dff2289dbfe9f61fccbbe824 (diff) |
run-script: Export the CWD that `npm` was run from to scripts
Credit: @MichaelQQ
Reviewed-By: @iarna
PR-URL: https://github.com/npm/npm/pull/12356
Diffstat (limited to 'lib/utils/lifecycle.js')
-rw-r--r-- | lib/utils/lifecycle.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/utils/lifecycle.js b/lib/utils/lifecycle.js index 412c1c694..649ce447f 100644 --- a/lib/utils/lifecycle.js +++ b/lib/utils/lifecycle.js @@ -80,6 +80,7 @@ function lifecycle (pkg, stage, wd, unsafe, failOk, cb) { env.npm_lifecycle_event = stage env.npm_node_execpath = env.NODE = env.NODE || process.execPath env.npm_execpath = require.main.filename + env.INIT_CWD = process.cwd() // 'nobody' typically doesn't have permission to write to /tmp // even if it's never used, sh freaks out. |