Skip to content

Commit

Permalink
Merge pull request #746 from jiyinyiyong/master
Browse files Browse the repository at this point in the history
fix --watch
  • Loading branch information
tj committed Aug 21, 2012
2 parents 000f6ed + 149086b commit c8c64e6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions bin/jade
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,8 @@ if (files.length) {
files.forEach(renderFile);
if (options.watch) {
files.forEach(function (file) {
fs.watchFile(file, {persistent: true, interval: 500}, function (prev, curr) {
if (prev.size !== curr.size && prev.mtime.getTime() !== curr.mtime.getTime()) {
renderFile(file);
}
fs.watchFile(file, {interval: 100}, function (curr, prev) {
if (curr.mtime > prev.mtime) renderFile(file);
});
});
}
Expand Down

0 comments on commit c8c64e6

Please sign in to comment.