1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

Issue #665. Recompile on --watch when file changes size, or mtime changes.

This commit is contained in:
Jeremy Ashkenas 2010-09-08 21:08:17 -04:00
parent 904207ba8f
commit df414dab02
2 changed files with 2 additions and 2 deletions

View file

@ -159,7 +159,7 @@
persistent: true,
interval: 500
}, function(curr, prev) {
if (curr.mtime.getTime() === prev.mtime.getTime()) {
if (curr.size === prev.size && curr.mtime.getTime() === prev.mtime.getTime()) {
return null;
}
return fs.readFile(source, function(err, code) {

View file

@ -133,7 +133,7 @@ compileStdio = ->
# such as `--lint` or `--print`.
watch = (source, base) ->
fs.watchFile source, {persistent: true, interval: 500}, (curr, prev) ->
return if curr.mtime.getTime() is prev.mtime.getTime()
return if curr.size is prev.size and curr.mtime.getTime() is prev.mtime.getTime()
fs.readFile source, (err, code) ->
throw err if err
compileScript(source, code.toString(), base)