Skip to content

Commit

Permalink
fix: don't ignore dot-directories
Browse files Browse the repository at this point in the history
Fixes #1223
  • Loading branch information
remy committed Jan 11, 2018
1 parent 60d1add commit 4be493c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lib/monitor/match.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
var minimatch = require('minimatch');
var path = require('path');
var fs = require('fs');
var utils = require('../utils');
const minimatch = require('minimatch');
const path = require('path');
const fs = require('fs');
const debug = require('debug')('nodemon:match');
const utils = require('../utils');

module.exports = match;
module.exports.rulesToMonitor = rulesToMonitor;
Expand Down Expand Up @@ -167,12 +168,16 @@ function match(files, monitor, ext) {
return '**' + (prefix !== path.sep ? path.sep : '') + s;
});

debug('rules', rules);

var good = [];
var whitelist = []; // files that we won't check against the extension
var ignored = 0;
var watched = 0;
var usedRules = [];
var minimatchOpts = {};
var minimatchOpts = {
dot: true,
};

// enable case-insensitivity on Windows
if (utils.isWindows) {
Expand All @@ -191,6 +196,7 @@ function match(files, monitor, ext) {
break;
}
} else {
debug('match', file, minimatch(file, rules[i], minimatchOpts));
if (minimatch(file, rules[i], minimatchOpts)) {
watched++;

Expand Down Expand Up @@ -225,6 +231,7 @@ function match(files, monitor, ext) {
}
});

debug('good', good)

// finally check the good files against the extensions that we're monitoring
if (ext) {
Expand Down
4 changes: 4 additions & 0 deletions lib/monitor/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,16 @@ function filterAndRestart(files) {
.join(', ')
);

debug('filterAndRestart on', files);

var matched = match(
files,
config.options.monitor,
undefsafe(config, 'options.execOptions.ext')
);

debug('matched?', JSON.stringify(matched));

// if there's no matches, then test to see if the changed file is the
// running script, if so, let's allow a restart
if (config.options.execOptions.script) {
Expand Down

0 comments on commit 4be493c

Please sign in to comment.