Skip to content

Commit

Permalink
Moving rewatch to end of function for scoping (thanks, satyr)
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorBurnham committed Dec 24, 2011
1 parent 46b34d4 commit 3b3c069
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
13 changes: 6 additions & 7 deletions lib/coffee-script/command.js

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

8 changes: 4 additions & 4 deletions src/command.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,6 @@ watch = (source, base) ->
compileJoin()
else throw e

rewatch = ->
watcher?.close()
watcher = fs.watch source, compile

compile = ->
clearTimeout compileTimeout
compileTimeout = wait 25, ->
Expand All @@ -208,6 +204,10 @@ watch = (source, base) ->
catch e
watchErr e

rewatch = ->
watcher?.close()
watcher = fs.watch source, compile


# Watch a directory of files for new additions.
watchDir = (source, base) ->
Expand Down

0 comments on commit 3b3c069

Please sign in to comment.