Skip to content

Commit

Permalink
Ensuring that fs.watch duplication does not occur
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorBurnham committed Nov 9, 2011
1 parent 966063d commit d30aa6d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions lib/coffee-script/command.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/command.coffee
Expand Up @@ -174,9 +174,10 @@ loadRequires = ->
watch = (source, base) ->
fs.stat source, (err, prevStats)->
throw err if err
fs.watch source, callback = (event) ->
watcher = fs.watch source, callback = (event) ->
if event is 'rename'
fs.watch source, callback
watcher.close()
watcher = fs.watch source, callback
else if event is 'change'
fs.stat source, (err, stats) ->
throw err if err
Expand Down

0 comments on commit d30aa6d

Please sign in to comment.