diff --git a/package.json b/package.json index 3f55a60..68a43b1 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { - "name": "grunt-contrib-watch", + "name": "@medic/grunt-contrib-watch", "description": "Run predefined tasks whenever watched file patterns are added, changed or deleted", - "version": "1.0.0", + "version": "1.0.1", "author": { "name": "Grunt Team", "url": "http://gruntjs.com/" }, - "repository": "gruntjs/grunt-contrib-watch", + "repository": "scdf/grunt-contrib-watch", "license": "MIT", "engines": { "node": ">=0.10.0" diff --git a/tasks/watch.js b/tasks/watch.js index b18c78a..ddbad96 100644 --- a/tasks/watch.js +++ b/tasks/watch.js @@ -11,6 +11,7 @@ var path = require('path'); var Gaze = require('gaze').Gaze; var _ = require('lodash'); +var globule = require('globule'); var waiting = 'Waiting...'; var changedFiles = Object.create(null); var watchers = []; @@ -147,6 +148,11 @@ module.exports = function(grunt) { return; } + // Skip non matching hits caused by Gaze on some systems + if (!globule.isMatch(patterns, filepath)) { + return; + } + // If Gruntfile.js changed, reload self task if (target.options.reload || /gruntfile\.(js|coffee)/i.test(filepath)) { taskrun.reload = true;