Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't ignore dot-directories #1224

Merged
merged 1 commit into from
Jan 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the actual fix.

};

// 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