Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Kalliokoski <jussi.kalliokoski@gmail.com>2015-02-19 11:50:36 +0300
committerForrest L Norvell <forrest@npmjs.com>2015-02-27 11:24:56 +0300
commitf33e8b8ff2de094071c5976be95e35110cf2ab1a (patch)
tree3db5f59a06dbdfb84e768a6d4e84a589813e4992 /lib/run-script.js
parent448efd0eaa6f97af0889bf47efc543a1ea2f8d7e (diff)
Added an --if-present flag for not erroring on unspecified scripts.
Fixes #7354.
Diffstat (limited to 'lib/run-script.js')
-rw-r--r--lib/run-script.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/run-script.js b/lib/run-script.js
index 7603e29e1..b6aa5fe7e 100644
--- a/lib/run-script.js
+++ b/lib/run-script.js
@@ -159,6 +159,8 @@ function run (pkg, wd, cmd, args, cb) {
log.verbose("run-script using default platform env: env (Unix)")
pkg.scripts[cmd] = "env"
}
+ } else if (npm.config.get("if-present")) {
+ return cb(null);
} else {
return cb(new Error("missing script: " + cmd))
}