Skip to content

Commit

Permalink
Updating watch task to use grunt.file.match instead of grunt.file.exp…
Browse files Browse the repository at this point in the history
…andFiles to properly handle deleted files.
  • Loading branch information
cowboy committed Apr 11, 2012
1 parent 2cadf23 commit 7a10c83
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tasks/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
});
Expand Down

0 comments on commit 7a10c83

Please sign in to comment.