From 4c7189e42a6bf2a4412a1d9a92a3ef72a0dd1a62 Mon Sep 17 00:00:00 2001 From: Antoine Bluchet Date: Wed, 29 Jul 2015 16:02:58 +0200 Subject: [PATCH 1/2] fix #1379 ignore_watch is empty --- lib/Watcher.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Watcher.js b/lib/Watcher.js index 9cbb73f8..e44a8102 100644 --- a/lib/Watcher.js +++ b/lib/Watcher.js @@ -25,12 +25,14 @@ module.exports = function ClusterMode(God) { //setup the combined RegEx var ignored = ''; - if (pm2_env.ignore_watch) { + if (util.isArray(pm2_env.ignore_watch) && pm2_env.ignore_watch.length) { var combined = pm2_env.ignore_watch.reduce(function(previous, current) { return previous + '|' + current; }); ignored = new RegExp(combined); + } else if (typeof pm2_env.ignore_watch == 'string') { + ignored = new RegExp(pm2_env.ignorew_watch) } else { ignored = /[\/\\]\.|node_modules/; } From 2ea41ef329117dc65d8e140b7760f6d47e46d4f5 Mon Sep 17 00:00:00 2001 From: Antoine Bluchet Date: Wed, 29 Jul 2015 16:04:30 +0200 Subject: [PATCH 2/2] fix #1373 ignore_watch consistency --- examples/process.json | 2 +- test/programmatic/json_validation.mocha.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/process.json b/examples/process.json index 71323e64..c11459ca 100644 --- a/examples/process.json +++ b/examples/process.json @@ -10,7 +10,7 @@ "script" : "child.js", "cwd" : "examples", "node_args" : "--harmony", - "ignoreWatch" : ["[\\/\\\\]\\./", "log"], + "ignore_watch" : ["[\\/\\\\]\\./", "log"], "watch" : true }] } diff --git a/test/programmatic/json_validation.mocha.js b/test/programmatic/json_validation.mocha.js index 9b6b947f..f617a8ed 100644 --- a/test/programmatic/json_validation.mocha.js +++ b/test/programmatic/json_validation.mocha.js @@ -14,7 +14,7 @@ describe('JSON validation tests', function() { "script" : "chidld.js", "cwd" : "examadsples", "node_args" : "--harmoasdny", - "ignoreWatch" : ["[\\/\\\\]\\./", "log"], + "ignore_watch" : ["[\\/\\\\]\\./", "log"], "watch" : "true" }); @@ -42,7 +42,7 @@ describe('JSON validation tests', function() { "cwd" : "examples", "node_args" : "--harmony", "max_memory_restart" : "10M", - "ignoreWatch" : ["[\\/\\\\]\\./", "log"], + "ignore_watch" : ["[\\/\\\\]\\./", "log"], "watch" : true, "node_args" : ["hey","hay"], "env" : {}