Skip to content

Commit

Permalink
Fix: Only attach our custom ignore function if there are negative globs
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Nov 16, 2018
1 parent 4fca711 commit 5681c11
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ function watch(glob, options, cb) {

var toWatch = positives.filter(exists);

opt.ignored = [].concat(opt.ignored, shouldBeIgnored);
// We only do add our custom `ignored` if there are some negative globs
// TODO: I'm not sure how to test this
if (negatives.some(exists)) {
opt.ignored = [].concat(opt.ignored, shouldBeIgnored);
}
var watcher = chokidar.watch(toWatch, opt);

function runComplete(err) {
Expand Down

0 comments on commit 5681c11

Please sign in to comment.