From eb69ab983e7ddf2e0f7d4c9cbe0ff6084105c362 Mon Sep 17 00:00:00 2001 From: Xiaojue Date: Tue, 1 Nov 2016 16:49:52 +0800 Subject: [PATCH 1/2] fix pidOrName compare processname type --- lib/cli/Actions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cli/Actions.js b/lib/cli/Actions.js index 18a579c7..416d4662 100644 --- a/lib/cli/Actions.js +++ b/lib/cli/Actions.js @@ -129,8 +129,8 @@ Actions.prototype._withEach = function (pidOrNames, options, withEach, afterAll) // remove the 'Cluster: ' from the cluster manager's name name = name.substring('Cluster: '.length) } - - if (name === pidOrName || managedProcess.pid === pidOrName || pidOrName === '*') { + //pidOrName maybe a number by user input + if (name == pidOrName || managedProcess.pid === pidOrName || pidOrName === '*') { tasks.push(function (managedProcess, callback) { withEach(managedProcess, guvnor, function (error) { if (managedProcess && managedProcess.disconnect) { From 0238e77cd442cbd0fd90b8aa00d659ab3e83be82 Mon Sep 17 00:00:00 2001 From: Xiaojue Date: Tue, 1 Nov 2016 17:05:53 +0800 Subject: [PATCH 2/2] add remove all --- lib/cli/Actions.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/cli/Actions.js b/lib/cli/Actions.js index 416d4662..8c15e8f4 100644 --- a/lib/cli/Actions.js +++ b/lib/cli/Actions.js @@ -130,7 +130,8 @@ Actions.prototype._withEach = function (pidOrNames, options, withEach, afterAll) name = name.substring('Cluster: '.length) } //pidOrName maybe a number by user input - if (name == pidOrName || managedProcess.pid === pidOrName || pidOrName === '*') { + //pidOrname maybe -a -something e,g. so i add remove all command. + if (name == pidOrName || managedProcess.pid === pidOrName || pidOrName === '*' || pidOrName === 'all') { tasks.push(function (managedProcess, callback) { withEach(managedProcess, guvnor, function (error) { if (managedProcess && managedProcess.disconnect) {