mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
Merge pull request #1482 from Unitech/fix-watch-issues
Fix some watch issues
This commit is contained in:
commit
cf229ec1be
@ -10,7 +10,7 @@
|
||||
"script" : "child.js",
|
||||
"cwd" : "examples",
|
||||
"node_args" : "--harmony",
|
||||
"ignoreWatch" : ["[\\/\\\\]\\./", "log"],
|
||||
"ignore_watch" : ["[\\/\\\\]\\./", "log"],
|
||||
"watch" : true
|
||||
}]
|
||||
}
|
||||
|
||||
@ -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/;
|
||||
}
|
||||
|
||||
@ -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" : {}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user