Skip to content

Commit

Permalink
fs.watch instead of watchFile on Windows (watchFile doesn't exist on …
Browse files Browse the repository at this point in the history
…Windows Node)
  • Loading branch information
cjblomqvist committed Apr 22, 2012
1 parent 7bc85fd commit deeb28b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/files.coffee
Expand Up @@ -147,8 +147,12 @@ module.exports =
options = interval: 100
extension = extensions[type]
files(dir, extension).forEach (file) ->
fs.watchFile file, options, (curr, prev) ->
onChange file if prev.mtime < curr.mtime
if process.platform is 'win32'
fs.watch file, (event) ->
onChange file if event is 'change'
else
fs.watchFile file, options, (curr, prev) ->
onChange file if prev.mtime < curr.mtime


onlyWhitespace = /^[\s\n]*$/
Expand Down

0 comments on commit deeb28b

Please sign in to comment.