Skip to content

Commit

Permalink
Add difference check when triggering tasks due to changes so delete i…
Browse files Browse the repository at this point in the history
…s detected
  • Loading branch information
szurcher committed Sep 6, 2016
1 parent eeb1e88 commit 658ee92
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tasks/simple_watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ module.exports = function(grunt) {
targets.forEach(function(target) {
var files = grunt.file.expand(target.files);
var intersection = grunt.util._.intersection(fileArray, files);
var difference = grunt.util._.difference(fileArray, files);
// Enqueue specified tasks if a matching file was found.
if (intersection.length > 0 && target.tasks) {
if ( (intersection.length > 0 || difference.length > 0) && target.tasks) {
grunt.task.run(target.tasks).mark();
}
});
Expand Down Expand Up @@ -201,4 +202,4 @@ module.exports = function(grunt) {
}, 200);
});

};
};

0 comments on commit 658ee92

Please sign in to comment.