From df414dab025ef90dcddeca0722d207034a5f9db3 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Wed, 8 Sep 2010 21:08:17 -0400 Subject: [PATCH] Issue #665. Recompile on --watch when file changes size, or mtime changes. --- lib/command.js | 2 +- src/command.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/command.js b/lib/command.js index 2d1241a8..36d89d57 100644 --- a/lib/command.js +++ b/lib/command.js @@ -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) { diff --git a/src/command.coffee b/src/command.coffee index c136e7a7..223218b8 100644 --- a/src/command.coffee +++ b/src/command.coffee @@ -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)