Permalink
Browse files

fix: npm run-script fails silently. closes #2959

  • Loading branch information...
1 parent fd2eb72 commit 7678f931eaa87eda09f8b54c4c4f09c324b40c66 @andrewrk committed Nov 25, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/run-script.js
View
4 lib/run-script.js
@@ -86,6 +86,10 @@ function run (pkg, wd, cmd, cb) {
,"restart"
,"prestart","start","poststart"]
} else {
+ if (!pkg.scripts[cmd]) {
+ cb(new Error("missing script: " + cmd));
+ return;
+ }
cmds = [cmd]
}
if (!cmd.match(/^(pre|post)/)) {

0 comments on commit 7678f93

Please sign in to comment.