Skip to content

Commit

Permalink
fix: in watch, use fully filtered ignore rules
Browse files Browse the repository at this point in the history
Fixes #1348
  • Loading branch information
remy committed May 23, 2018
1 parent ff79835 commit b3fc3a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/monitor/match.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ function match(files, monitor, ext) {
var prefix = s.slice(0, 1);

if (prefix === '!') {
if (s.indexOf('!' + cwd) === 0) {
return s;
}
return '!**' + (prefix !== path.sep ? path.sep : '') + s.slice(1);
}

Expand Down
7 changes: 6 additions & 1 deletion lib/monitor/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ function watch() {

const promise = new Promise(function (resolve) {
const dotFilePattern = /[/\\]\./;
var ignored = Array.from(rootIgnored);
var ignored = match.rulesToMonitor(
[], // not needed
Array.from(rootIgnored),
config
).map(pattern => pattern.slice(1));

const addDotFile = dirs.filter(dir => dir.match(dotFilePattern));

// don't ignore dotfiles if explicitly watched.
Expand Down

0 comments on commit b3fc3a9

Please sign in to comment.