mirror of
https://github.com/SrIzan10/nodemon.git
synced 2026-05-01 10:55:09 +00:00
Watch lib/*.* ignores the extension check. Closes #255
This commit is contained in:
@@ -27,6 +27,7 @@ function match(files, monitor, ext) {
|
||||
});
|
||||
|
||||
var good = [],
|
||||
whitelist = [], // files that we won't check against the extension
|
||||
ignored = 0,
|
||||
watched = 0;
|
||||
|
||||
@@ -43,7 +44,17 @@ function match(files, monitor, ext) {
|
||||
if (minimatch(file, rules[i])) {
|
||||
watched++;
|
||||
utils.log.detail('matched rule: ' + rules[i]);
|
||||
good.push(file);
|
||||
|
||||
// if the rule doesn't match the WATCH EVERYTHING
|
||||
// but *does* match a rule that ends with *.*, then
|
||||
// white list it - in that we don't run it through
|
||||
// the extension check too.
|
||||
if (rules[i] !== '**/*.*' && rules[i].slice(-3) === '*.*') {
|
||||
console.log(file, rules[i]);
|
||||
whitelist.push(file);
|
||||
} else {
|
||||
good.push(file);
|
||||
}
|
||||
matched = true;
|
||||
break;
|
||||
}
|
||||
@@ -69,7 +80,7 @@ function match(files, monitor, ext) {
|
||||
} // else assume *.*
|
||||
|
||||
return {
|
||||
result: good,
|
||||
result: good.concat(whitelist),
|
||||
ignored: ignored,
|
||||
watched: watched,
|
||||
total: files.length
|
||||
|
||||
@@ -40,7 +40,7 @@ describe('match', function () {
|
||||
|
||||
var result = match(files, ['*.*'], 'js');
|
||||
|
||||
assert.deepEqual(result.result, [], 'no results returned');
|
||||
assert.deepEqual(result.result, [], 'no results returned: ' + result.result);
|
||||
});
|
||||
|
||||
it('should match .coffee if watching *.js & *.coffee', function (done) {
|
||||
|
||||
Reference in New Issue
Block a user