Skip to content

Commit 477082b

Browse files
kerphiindexzero
authored andcommitted
add the --watchIgnore option to be able to ignore files or directories when --watch is enabled
1 parent 5fa39ce commit 477082b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/forever/cli.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ var help = [
6060
' -s, --silent Run the child script silencing stdout and stderr',
6161
' -w, --watch Watch for file changes',
6262
' --watchDirectory Top-level directory to watch from',
63+
' --watchIgnore To ignore pattern when watch is enabled (multiple option is allowed)',
6364
' -h, --help You\'re staring at it',
6465
'',
6566
'[Long Running Process]',
@@ -198,10 +199,13 @@ var getOptions = cli.getOptions = function (file) {
198199
[
199200
'pidFile', 'logFile', 'errFile', 'watch', 'minUptime', 'append',
200201
'silent', 'outFile', 'max', 'command', 'path', 'spinSleepTime',
201-
'sourceDir', 'uid', 'watchDirectory', 'killTree', 'killSignal'
202+
'sourceDir', 'uid', 'watchDirectory', 'watchIgnore', 'killTree', 'killSignal'
202203
].forEach(function (key) {
203204
options[key] = app.config.get(key);
204205
});
206+
207+
options.watchIgnore = options.watchIgnore || [ ];
208+
options.watchIgnorePatterns = (options.watchIgnore instanceof Array) ? options.watchIgnore : [ options.watchIgnore ];
205209

206210
if (!options.minUptime) {
207211
forever.log.warn('--minUptime not set. Defaulting to: 1000ms');

0 commit comments

Comments
 (0)