Skip to content

Commit

Permalink
[fix] relative script file should works fine, both with start or `s…
Browse files Browse the repository at this point in the history
…top`.
  • Loading branch information
Tjatse authored and indexzero committed Nov 4, 2014
1 parent 84cf5ad commit 8f7dfba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/forever.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8f7dfba

Please sign in to comment.