Skip to content

Commit

Permalink
lifecycle: avoid building environment for empty lifecycle scripts
Browse files Browse the repository at this point in the history
Credit: @mikesherov
Reviewed-By: @iarna
PR-URL: npm/npm#17441
  • Loading branch information
mikesherov authored and iarna committed Jun 26, 2017
1 parent 9589c1c commit e084987
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/utils/lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit e084987

Please sign in to comment.