diff --git a/lib/forever-monitor/monitor.js b/lib/forever-monitor/monitor.js index d9fc7c0..44690ea 100755 --- a/lib/forever-monitor/monitor.js +++ b/lib/forever-monitor/monitor.js @@ -43,6 +43,7 @@ const Monitor = (exports.Monitor = function(script, options) { // options = options || {}; this.silent = options.silent || false; + this.skipIgnoreFile = options.skipIgnoreFile || false; this.killTree = options.killTree !== false; this.uid = options.uid || utile.randomString(4); this.id = options.id || false; diff --git a/lib/forever-monitor/plugins/watch.js b/lib/forever-monitor/plugins/watch.js index e15e299..edaed20 100644 --- a/lib/forever-monitor/plugins/watch.js +++ b/lib/forever-monitor/plugins/watch.js @@ -74,22 +74,24 @@ exports.attach = function() { } watchDirectory.forEach(function(directory) { - fs.readFile(path.join(directory, '.foreverignore'), 'utf8', function( - err, - data - ) { - if (err) { - return monitor.emit('watch:error', { - message: 'Could not read .foreverignore file.', - error: err.message, - }); - } + if (!monitor.skipIgnoreFile) { + fs.readFile(path.join(directory, '.foreverignore'), 'utf8', function( + err, + data + ) { + if (err) { + return monitor.emit('watch:error', { + message: 'Could not read .foreverignore file.', + error: err.message, + }); + } - Array.prototype.push.apply( - monitor.watchIgnorePatterns, - data.split('\n').filter(Boolean) - ); - }); + Array.prototype.push.apply( + monitor.watchIgnorePatterns, + data.split('\n').filter(Boolean) + ); + }); + } }); const opts = {