this will list all current files in a directory
var chokidar = require('chokidar')
var watcher = chokidar.watch('./public/images', {persistent: true})
watcher.on('add', function(path){
console.log(path, ' added')
})
if I use the ignoreInitial option like so, it will skip initial files, but will print them again when a new file is added
var chokidar = require('chokidar')
var watcher = chokidar.watch('./public/images', {persistent: true, ignoreInitial: true})
watcher.on('add', function(path){
console.log(path, ' added')
})
related to #110, I'm using linux
I was able to reproduce the problem, and then try again after merging the changes in #124. Master branch appears to behave correctly now.
I have the same issue on macOS currently.
With the code
watcher.on('add', path => {
logger.debug('added file %s', path);
});
I do get:
When I add ignoreInitial (even given I don't want this for my case), it ignores the first watch round, but gives me all files when a file is added or removed.
Most helpful comment
I have the same issue on macOS currently.
With the code
watcher.on('add', path => { logger.debug('added file %s', path); });I do get:
When I add ignoreInitial (even given I don't want this for my case), it ignores the first watch round, but gives me all files when a file is added or removed.