mirror of
https://github.com/SrIzan10/nodemon.git
synced 2026-05-01 10:55:09 +00:00
removed a loop
This commit is contained in:
8
nodemon
8
nodemon
@@ -10,8 +10,8 @@ var fs = require('fs'),
|
||||
monitor = null,
|
||||
ignoreFilePath = __dirname + '/ignore',
|
||||
ignoreFileTime = null,
|
||||
reIgnoreFiles = null,
|
||||
ignoreFiles = [flag], // ignore the monitor flag by default
|
||||
reIgnoreFiles = null,
|
||||
timeout = 1000, // check every 1 second
|
||||
// create once, reuse as needed
|
||||
reComments = /#.*$/,
|
||||
@@ -80,12 +80,10 @@ function readIgnoreFile() {
|
||||
fs.readFileSync(ignoreFilePath).toString().split(/\n/).forEach(function (line) {
|
||||
// remove comments and trim lines
|
||||
if (line = line.replace(reComments, '').replace(reTrim, '')) {
|
||||
ignoreFiles.push(line);
|
||||
ignoreFiles.push(line.replace(reEscapeChars, '\\$&').replace(reAsterisk, '.*'));
|
||||
}
|
||||
});
|
||||
reIgnoreFiles = new RegExp(ignoreFiles.map(function(file) {
|
||||
return file.replace(reEscapeChars, '\\$&').replace(reAsterisk, '.*');
|
||||
}).join('|'));
|
||||
reIgnoreFiles = new RegExp(ignoreFiles.join('|'));
|
||||
|
||||
fs.watchFile(ignoreFilePath, { persistent: false }, readIgnoreFile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user