From 8f7dfbaa81651e8f3a4dd532000a36515a42acb3 Mon Sep 17 00:00:00 2001 From: Tjatse Date: Sun, 2 Nov 2014 13:10:28 +0800 Subject: [PATCH] [fix] relative script file should works fine, both with `start` or `stop`. --- lib/forever.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/forever.js b/lib/forever.js index 765791c4..099fdccd 100644 --- a/lib/forever.js +++ b/lib/forever.js @@ -663,8 +663,10 @@ forever.findByIndex = function (index, processes) { forever.findByScript = function (script, processes) { if (!processes) return null; + // make script absolute. + script.indexOf('/') != 0 && (script = path.resolve(process.cwd(), script)); var procs = processes.filter(function (p) { - return p.file === script; + return p.file === script || path.join(p.spawnWith.cwd, p.file) === script; }); if (procs.length === 0) procs = null;