-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only one change detected for non-glob patterns with atomic save #141
Comments
Well, the difference isn't between globs and non-globs, it's between watching a directory (globs effectively watch a directory with a filter) and watching an individual file. I'm assuming you're encountering this on Linux? |
Indeed, Debian 8. |
So, do you consider it as a bug or should I use a work around? |
Probably a bug. Need to investigate But by all means - use a workaround for now since it's easy. |
For information, I think the best workaround is to use a character class for a single character: var gulp = require('gulp');
var watch = require('gulp-watch');
gulp.task('default', function () {
return watch('[f]oo.txt', {
verbose: true,
});
}); |
the problem is still exist // less
watch([
path.join(global.paths.app, 'less', '**', '*.{less,js}'), // <--- all these files changes are well detected
path.join(global.paths.config, 'metrics.js') // <--- only the first change
], function () {
gulp.start('less:develop');
}); |
Crossref paulmillr/chokidar#237 |
I see |
Nobody called it elegant. It's a thankfully simple, albeit ugly, workaround for a bug that hasn't been squished yet. |
anyway thanks for pointing me in the right direction |
This seems to have been fixed upstream. Please comment/reopen if you are still experiencing this issue. |
When the pattern does not contain a glob and the file is saved atomically (copy and move over, like SublimeText does), only the first change is detected.
If the file is just touched (
touch foo.txt
) it works normally but if it is replaced (cp foo.txt _tmp && mv -f _tmp foo.txt
) then the watch breaks.If the pattern contains a glob (
foo*.txt
) then it works as it should./cc @es128.
The text was updated successfully, but these errors were encountered: