Skip to content

Commit

Permalink
Fixed a bug where numbers in the file path caused forever to think
Browse files Browse the repository at this point in the history
that it should stop the script based on index instead of stopping
it based on script.

Removing the digit check solved this issue. If the index isn't found
it will return a `null` value and it will attempt to find the script
based by the target path which will pass.
  • Loading branch information
3rd-Eden committed Jul 13, 2011
1 parent df54bc0 commit 7ff26de
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/forever.js
Expand Up @@ -284,9 +284,8 @@ forever.stop = function (target, format, restart) {
results = [];

getAllProcesses(function (processes) {
var procs = /(\d+)/.test(target)
? forever.findByIndex(target, processes)
: forever.findByScript(target, processes);
var procs = forever.findByIndex(target, processes)
|| forever.findByScript(target, processes);

if (procs && procs.length > 0) {
procs.forEach(function (proc) {
Expand Down

0 comments on commit 7ff26de

Please sign in to comment.