-
Notifications
You must be signed in to change notification settings - Fork 356
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
inotify support #255
Comments
We use gaze which does use inotify for some files on linux. Gaze watches the way it does for a few reasons: it handles Grunt compatible file patterns, it handles safe rewrites among other use cases raised by our users over the year+, still supports node v0.8 to maintain compatibility with Grunt (which still supports v0.8) and is cross-platform compatible.
Also, please correct me if Im wrong, but watchr doesn't appear to support file patterns and doesn't use You can use grunt.registerTask('mywatch', function() {
var done = this.async();
require('fs').watch('somedir', function(event, filename) {
grunt.task.run(['jshint', 'mywatch']);
done();
});
}); I really wished the above worked for everyone else though. Maybe in node 1.0.0 :) |
@shama How can I "pause" the watch for the time the callback is running? E.g. if the "jshint" task itself would trigger a filesystem change in "somedir". In my case, the task is a shell process creating a ctags file, and while I can ignore changes to the tags file itself, I do not want to have multiple ctags processes running in parallel in any case. |
You can't (at least not easily) atm. That is something I'd like to support in the future though: shama/gaze#29 |
Is this documented somewhere? I find that it does not use inotify even for a single file?! Is it possible to require/use fs.watch directly through the loaded NpmTask (in grunt.initConfig)? I wanted to use this for the livereload feature, but without inotify it's not much fun. |
I have setup grunt and use grunt-contrib-watch to watch a whole directory.
Unfortunately, it appears to constantly stat all the files in there. I would have expected that something like inotify would get used on Linux.
Am I missing something?
Would it make sense to use https://github.com/bevry/watchr to abstract the actual watching process?
The text was updated successfully, but these errors were encountered: