From 2c394ab600c19d8c6474dabc6c1cb5cc6d01b9fe Mon Sep 17 00:00:00 2001 From: Tjatse Date: Sun, 9 Nov 2014 19:23:58 +0800 Subject: [PATCH] `forever stopbypid` is deprecated now, using `forever stop ` instead. --- README.md | 3 +-- lib/forever/cli.js | 16 +++------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index b593951f..c4aab78d 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,8 @@ You can use forever to run any kind of script continuously (whether it is writte actions: start Start SCRIPT as a daemon - stop Stop the daemon SCRIPT + stop Stop the daemon SCRIPT by Id|Uid|Pid|Index|Script stopall Stop all running forever scripts - stopbypid Stop running forever script by pid restart Restart the daemon SCRIPT restartall Restart all running forever scripts list List all running forever scripts diff --git a/lib/forever/cli.js b/lib/forever/cli.js index 37472dc5..52dff203 100644 --- a/lib/forever/cli.js +++ b/lib/forever/cli.js @@ -23,9 +23,8 @@ var help = [ '', 'actions:', ' start Start SCRIPT as a daemon', - ' stop Stop the daemon SCRIPT', + ' stop Stop the daemon SCRIPT by Id|Uid|Pid|Index|Script', ' stopall Stop all running forever scripts', - ' stopbypid Stop running forever script by pid', ' restart Restart the daemon SCRIPT', ' restartall Restart all running forever scripts', ' list List all running forever scripts', @@ -294,17 +293,8 @@ app.cmd(/stop (.+)/, cli.stop = function (file) { // Stops running forever process by pid. // app.cmd(/stopbypid (.+)/, cli.stopbypid = function (pid) { - var runner = forever.stopbypid(pid, true); - - runner.on('stop', function (process) { - forever.log.info('Forever stopped process:'); - forever.log.data(process); - }); - - runner.on('error', function (err) { - forever.log.error('Forever cannot find process with pid: ' + pid); - process.exit(1); - }); + forever.log.warn('Deprecated, try `forever stop ' + pid + '` instead.'); + cli.stop(pid); }); //