Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updating watch task to use grunt.file.match instead of grunt.file.exp…

…andFiles to properly handle deleted files.
  • Loading branch information...
commit 7a10c83a3733d1a5dbf94bcfccc5b45c2ad65918 1 parent 2cadf23
@cowboy authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 tasks/watch.js
View
8 tasks/watch.js
@@ -89,10 +89,10 @@ module.exports = function(grunt) {
// For each specified target, test to see if any files matching that
// target's file patterns were modified.
targets.forEach(function(target) {
- var files = grunt.file.expandFiles(target.files);
- var intersection = grunt.utils._.intersection(fileArray, files);
- // Enqueue specified tasks if a matching file was found.
- if (intersection.length > 0 && target.tasks) {
+ // What files in fileArray match the target.files pattern(s)?
+ var files = grunt.file.match(target.files, fileArray);
+ // Enqueue specified tasks if at least one matching file was found.
+ if (files.length > 0 && target.tasks) {
grunt.task.run(target.tasks).mark();
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.