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
path: root/lib
diff options
context:
space:
mode:
authorDaijiro Wachi <daijiro.wachi@gmail.com>2015-02-26 16:34:36 +0300
committerForrest L Norvell <forrest@npmjs.com>2015-02-27 05:57:34 +0300
commit2f6a1df3e1e3e0a3bc4abb69e40f59a64204e7aa (patch)
tree8f14818ab4bb90808918fed0222662e6ba38843c /lib
parent13b4121a30a910a2b287493b5a2a79daccd04332 (diff)
run-script: only run restart lifecyle when no script
Fixes #1999, #2716.
Diffstat (limited to 'lib')
-rw-r--r--lib/run-script.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/run-script.js b/lib/run-script.js
index ce8ea0f13..e96439859 100644
--- a/lib/run-script.js
+++ b/lib/run-script.js
@@ -116,12 +116,10 @@ function run (pkg, wd, cmd, args, cb) {
if (!pkg.scripts) pkg.scripts = {}
var cmds
- if (cmd === "restart") {
- cmds = [
- "prestop", "stop", "poststop",
- "restart",
- "prestart", "start", "poststart"
- ]
+ if (cmd === "restart" && !pkg.scripts.restart) {
+ cmds = [ "prestop", "stop", "poststop"
+ , "prestart", "start", "poststart"
+ ]
} else {
if (!pkg.scripts[cmd]) {
if (cmd === "test") {