Skip to content

Commit

Permalink
fix: ignore dotfiles only if not explicitly told to do so
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinawoo committed Sep 16, 2015
1 parent cde21fb commit 4826c87
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/monitor/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,16 @@ function watch() {

dirs.forEach(function (dir) {
var promise = new Promise(function (resolve) {
var ignored = config.options.ignore.re;
var dotFilePattern = /[\/\\]\./;

// don't ignore dotfiles if explicitly watched.
if (!dir.match(dotFilePattern)) {
ignored = new RegExp(ignored.source + dotFilePattern.source);
}

var watcher = chokidar.watch(dir, {
// ignore our files, but also ignore dotfiles
ignored: [config.options.ignore.re, /[\/\\]\./],
ignored: ignored,
persistent: true,
});

Expand Down

0 comments on commit 4826c87

Please sign in to comment.