diff options
Diffstat (limited to 'deps/npm/lib/utils/lifecycle.js')
-rw-r--r-- | deps/npm/lib/utils/lifecycle.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/deps/npm/lib/utils/lifecycle.js b/deps/npm/lib/utils/lifecycle.js index f8b34d7bef..412c1c6944 100644 --- a/deps/npm/lib/utils/lifecycle.js +++ b/deps/npm/lib/utils/lifecycle.js @@ -60,6 +60,8 @@ function lifecycle (pkg, stage, wd, unsafe, failOk, cb) { delete pkg.scripts.prepublish } + if (!pkg.scripts[stage]) return cb() + validWd(wd || path.resolve(npm.dir, pkg.name), function (er, wd) { if (er) return cb(er) @@ -262,7 +264,11 @@ function runCmd_ (cmd, pkg, env, wd, stage, unsafe, uid, gid, cb_) { var sh = 'sh' var shFlag = '-c' - if (process.platform === 'win32') { + var customShell = npm.config.get('script-shell') + + if (customShell) { + sh = customShell + } else if (process.platform === 'win32') { sh = process.env.comspec || 'cmd' shFlag = '/d /s /c' conf.windowsVerbatimArguments = true |