Permalink
Browse files

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

…andFiles to properly handle deleted files.
  • Loading branch information...
1 parent 2cadf23 commit 7a10c83a3733d1a5dbf94bcfccc5b45c2ad65918 @cowboy committed Apr 11, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 tasks/watch.js
View
@@ -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();
}
});

0 comments on commit 7a10c83

Please sign in to comment.