Skip to content

Commit

Permalink
add the --watchIgnore option to be able to ignore files or directorie…
Browse files Browse the repository at this point in the history
…s when --watch is enabled
  • Loading branch information
kerphi authored and indexzero committed Apr 21, 2013
1 parent 5fa39ce commit 477082b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/forever/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]',
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 477082b

Please sign in to comment.