mirror of
https://github.com/SrIzan10/nodemon.git
synced 2026-05-01 10:55:09 +00:00
@@ -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;
|
||||
@@ -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) {
|
||||
@@ -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++;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user