cli ux: when command is errored do not display process list to avoid confusion

This commit is contained in:
Unitech 2019-06-29 01:43:22 -07:00
parent 37b9de7811
commit 24026750a9

View File

@ -1373,7 +1373,7 @@ class API {
that.Client.executeRemote(action_name, opts, function(err, res) {
if (err) {
Common.printError(conf.PREFIX_MSG_ERR + 'Process %s not found', id);
return next('Process not found');
return next(`Process ${id} not found`);
}
if (action_name == 'restartProcessId') {
@ -1658,6 +1658,9 @@ class API {
var that = this;
var systemdata = null
if (code != 0 && code != null) {
return that.exitCli(code ? code : conf.SUCCESS_EXIT);
}
// Do nothing if PM2 called programmatically and not called from CLI (also in exitCli)
if (conf.PM2_PROGRAMMATIC && process.env.PM2_USAGE != 'CLI') return false;