Permalink
Browse files

Fixes a problem preventing the last path in a series from being tied …

…to a watcher
  • Loading branch information...
1 parent cca795a commit 3a25457a22b3a7273aec28ee08e474e9525bf7e0 @caseywebdev caseywebdev committed Sep 2, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/lib/watchr.coffee
View
4 src/lib/watchr.coffee
@@ -451,11 +451,11 @@ watch = (opts,next) ->
# Prepare
result = []
tasks = new balUtil.Group (err) ->
- next(err,result)
+ next?(err,result)
balUtil.each paths, (path) -> tasks.push (complete) ->
localOpts = balUtil.extend({},opts)
localOpts.path = path
- localOpts.next = complete()
+ localOpts.next = complete
watchr = createWatcher(localOpts)
result.push(watchr) if watchr
tasks.async() # by async here we actually mean parallel, as our tasks are actually synchronous

0 comments on commit 3a25457

Please sign in to comment.