From 86b63f2c2bb4bea9e168897e72a6a9dbe03a794f Mon Sep 17 00:00:00 2001 From: ww9 Date: Thu, 14 Mar 2019 16:36:51 -0400 Subject: [PATCH 1/2] Add --skipIgnoreFile argument --- lib/forever-monitor/monitor.js | 1 + lib/forever-monitor/plugins/watch.js | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/forever-monitor/monitor.js b/lib/forever-monitor/monitor.js index 02c75e6..d58c83a 100755 --- a/lib/forever-monitor/monitor.js +++ b/lib/forever-monitor/monitor.js @@ -45,6 +45,7 @@ var 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 f1d96d8..4b7ed9b 100644 --- a/lib/forever-monitor/plugins/watch.js +++ b/lib/forever-monitor/plugins/watch.js @@ -51,16 +51,18 @@ exports.attach = function () { var watchDirectory = this.watchDirectory, monitor = this; - fs.readFile(path.join(this.watchDirectory, '.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(this.watchDirectory, '.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)); + }); + } var opts = { usePolling: this.usePolling, From a2a34e0a4ad563a3af2c694c31b38ec82310bc32 Mon Sep 17 00:00:00 2001 From: Igor Savin Date: Sun, 5 Jan 2020 19:21:21 +0100 Subject: [PATCH 2/2] Sync with master --- lib/forever-monitor/monitor.js | 2 +- lib/forever-monitor/plugins/watch.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/forever-monitor/monitor.js b/lib/forever-monitor/monitor.js index e3c1734..44690ea 100755 --- a/lib/forever-monitor/monitor.js +++ b/lib/forever-monitor/monitor.js @@ -43,7 +43,7 @@ const Monitor = (exports.Monitor = function(script, options) { // options = options || {}; this.silent = options.silent || false; - this.skipIgnoreFile = options.skipIgnoreFile || 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 0a581e4..edaed20 100644 --- a/lib/forever-monitor/plugins/watch.js +++ b/lib/forever-monitor/plugins/watch.js @@ -75,9 +75,9 @@ exports.attach = function() { watchDirectory.forEach(function(directory) { if (!monitor.skipIgnoreFile) { - fs.readFile(path.join(directory, '.foreverignore'), 'utf8', function ( - err, - data + fs.readFile(path.join(directory, '.foreverignore'), 'utf8', function( + err, + data ) { if (err) { return monitor.emit('watch:error', { @@ -87,8 +87,8 @@ exports.attach = function() { } Array.prototype.push.apply( - monitor.watchIgnorePatterns, - data.split('\n').filter(Boolean) + monitor.watchIgnorePatterns, + data.split('\n').filter(Boolean) ); }); }