Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Fix #78. Better error message for script failures
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jul 25, 2010
1 parent 9e1e719 commit c4aea02
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/utils/lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@ function lifecycle (pkg, stage, cb) {
// NOTE: The env vars won't work until node supports env hashes for child procs
var env = makeEnv(pkg)
env.npm_lifecycle_event = stage
env.npm_lifecycle_script = pkg.scripts[stage]

// support stuff like "make install" or "node test/all.js"
var args = pkg.scripts[stage].split(/\s/)
, script = args.shift()
exec(script, args, env, function (er, ok) {
cb(er, ok)
})
exec("sh", ["-c", env.npm_lifecycle_script], env, log.er(cb,
"Failed to exec "+stage+" script"))
}

function makeEnv (data, prefix, env) {
Expand Down

0 comments on commit c4aea02

Please sign in to comment.