From 477082bee1501e4028bd443fe9932f2ab0c5c4ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Gully?= Date: Sun, 7 Apr 2013 14:01:44 +0200 Subject: [PATCH] add the --watchIgnore option to be able to ignore files or directories when --watch is enabled --- lib/forever/cli.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/forever/cli.js b/lib/forever/cli.js index b779dcc7..b1cf288b 100644 --- a/lib/forever/cli.js +++ b/lib/forever/cli.js @@ -60,6 +60,7 @@ var help = [ ' -s, --silent Run the child script silencing stdout and stderr', ' -w, --watch Watch for file changes', ' --watchDirectory Top-level directory to watch from', + ' --watchIgnore To ignore pattern when watch is enabled (multiple option is allowed)', ' -h, --help You\'re staring at it', '', '[Long Running Process]', @@ -198,10 +199,13 @@ var getOptions = cli.getOptions = function (file) { [ 'pidFile', 'logFile', 'errFile', 'watch', 'minUptime', 'append', 'silent', 'outFile', 'max', 'command', 'path', 'spinSleepTime', - 'sourceDir', 'uid', 'watchDirectory', 'killTree', 'killSignal' + 'sourceDir', 'uid', 'watchDirectory', 'watchIgnore', 'killTree', 'killSignal' ].forEach(function (key) { options[key] = app.config.get(key); }); + + options.watchIgnore = options.watchIgnore || [ ]; + options.watchIgnorePatterns = (options.watchIgnore instanceof Array) ? options.watchIgnore : [ options.watchIgnore ]; if (!options.minUptime) { forever.log.warn('--minUptime not set. Defaulting to: 1000ms');