mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Rewatching on every file event, be it change or rename
This commit is contained in:
@@ -225,19 +225,15 @@
|
||||
};
|
||||
try {
|
||||
return watcher = fs.watch(source, callback = function(event) {
|
||||
if (event === 'change') {
|
||||
return compile();
|
||||
} else if (event === 'rename') {
|
||||
watcher.close();
|
||||
return wait(250, function() {
|
||||
compile();
|
||||
try {
|
||||
return watcher = fs.watch(source, callback);
|
||||
} catch (e) {
|
||||
return watchErr(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
return wait(250, function() {
|
||||
compile();
|
||||
try {
|
||||
watcher.close();
|
||||
return watcher = fs.watch(source, callback);
|
||||
} catch (e) {
|
||||
return watchErr(e);
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch (e) {
|
||||
return watchErr(e);
|
||||
|
||||
@@ -196,16 +196,13 @@ watch = (source, base) ->
|
||||
|
||||
try
|
||||
watcher = fs.watch source, callback = (event) ->
|
||||
if event is 'change'
|
||||
wait 250, ->
|
||||
compile()
|
||||
else if event is 'rename'
|
||||
watcher.close()
|
||||
wait 250, ->
|
||||
compile()
|
||||
try
|
||||
watcher = fs.watch source, callback
|
||||
catch e
|
||||
watchErr e
|
||||
try
|
||||
watcher.close()
|
||||
watcher = fs.watch source, callback
|
||||
catch e
|
||||
watchErr e
|
||||
catch e
|
||||
watchErr e
|
||||
|
||||
|
||||
Reference in New Issue
Block a user