Skip to content

Commit

Permalink
Switch to fs.watchFile on node 0.8 on win32.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Jul 26, 2012
1 parent 1580b1e commit c36eb0b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
fs = require 'fs'
sysPath = require 'path'

nodeVersion = process.versions.node.substring(0, 3)

# Watches files & directories for changes.
#
# Emitted events: `add`, `change`, `unlink`, `error`.
Expand Down Expand Up @@ -82,7 +84,7 @@ exports.FSWatcher = class FSWatcher extends EventEmitter
return if parent.indexOf(basename) >= 0

@_addToWatchedDir directory, basename
if process.platform is 'win32'
if process.platform is 'win32' and nodeVersion is '0.6'
watcher = fs.watch item, options, (event, path) =>
callback item
@watchers.push watcher
Expand Down

0 comments on commit c36eb0b

Please sign in to comment.