grunt-contrib-watch
grunt-contrib-watch copied to clipboard
Watch fires when a directory is created in the same directory as a file target
Test case repository: https://github.com/SCdF/grunt-contrib-watch-watches-dirs-by-mistake
Basically, given the following watch config:
watch: {
shouldFire: {
files: ['shouldFire', 'shouldFireDir/shouldFire'],
tasks: ['printstuff']
}
}
I would expect that only two files could cause the task to fire: the shouldFire
file and the second shouldFire
file under the shouldFireDir
directory.
However, the task is fired if a directory is created in either the repo's root directory, or under the shouldFireDir
directory. For example, if I mkdir blah
in the root directory, this task fires. Note that this issue only occurs if you create a directory: touch
ing a file does not cause the task to incorrectly fire.
Either this is incorrect or I do not understand how the files
matching syntax works.
Looks like this is caused by Gaze: https://github.com/shama/gaze/issues/204
Created the following PR to work around Gaze: https://github.com/gruntjs/grunt-contrib-watch/pull/520