Adding file to a folder being watched doesn't catch and changing file --> show as deleted
I am windows 7/ node v0.10.24 / gaze latest (0.6.4)
Adding file to a folder being watched doesn't catch and changing a watched file --> show as deleted events thrown only once for each file...
Could you provide an example of what you have tried? Thanks!
let me take back the 2nd and 3rd issue --. When I do the change from sublime text 3...it says I deleted...kind of wierd. and from there on when I make any more change..no events..because for gaze it is already deleted.when I changed the file from notepad++ after restarting the program...it is saying changed.
Adding file to a folder being watched doesn't catch
var gaze = require('gaze');
// Watch all .js files/dirs in process.cwd()
gaze('c:/w-jobs/**/*.coffee', function(err, watcher) {
// Files have all started watching
// watcher === this
// Get all watched files
this.watched(function(err, watched) {
console.log(watched);
});
// On file changed
this.on('changed', function(filepath) {
console.log(filepath + ' was changed');
});
// On file added
this.on('added', function(filepath) {
console.log(filepath + ' was added');
});
// On file deleted
this.on('deleted', function(filepath) {
console.log(filepath + ' was deleted');
});
// On changed/added/deleted
this.on('all', function(event, filepath) {
console.log(filepath + ' was ' + event);
});
// Get watched files with relative paths
this.relative(function(err, files) {
console.log(files);
});
});
Try this instead and let me know if that fixes it.
gaze('**/*.coffee', { cwd: 'c:/w-jobs/' }, function(err, watcher) {
It seems to help with the deleted event getting triggered for changed files (in sublime) but it first added..and from then on it is just showing changed...but at first it said added followed by changed.
but it didn't help with the addition of file to the folder
if i run this program under the same directory under which all the things are done...it is working say for eg I am c:\w and I am watching */.coffee it works fine if I add a file.coffee to the c:\w\coff\1.coffee .. But If I try to watch a different directory c:\w-jobs ..it doesn't work even though I tried cwd...ANY CLUES please
Same issue here - on first change any file is emitted as added before changed.
This is sort of a Sublime issue, with the way SublimeText 3 handles Atomic Saves - http://stackoverflow.com/questions/20634684/what-is-sublime-text-doing-when-i-save-a-file
Yep. Seeing the same issue here with ST3....