diff --git a/src/phage/action/PhageAgentAction.php b/src/phage/action/PhageAgentAction.php --- a/src/phage/action/PhageAgentAction.php +++ b/src/phage/action/PhageAgentAction.php @@ -99,13 +99,15 @@ $exit_code = $message['err']; + $command->setExitCode($exit_code); + if ($exit_code != 0) { $exit_code = $this->formatOutput( pht( 'Command ("%s") exited nonzero ("%s")!', $command->getCommand(), $exit_code), - $key.'/exit'); + $command->getLabel()); fprintf(STDOUT, '%s', $exit_code); } diff --git a/src/phage/action/PhageExecuteAction.php b/src/phage/action/PhageExecuteAction.php --- a/src/phage/action/PhageExecuteAction.php +++ b/src/phage/action/PhageExecuteAction.php @@ -5,6 +5,7 @@ private $command; private $label; + private $exitCode; public function isContainerAction() { return false; @@ -28,4 +29,13 @@ return $this->label; } + public function setExitCode($exit_code) { + $this->exitCode = $exit_code; + return $this; + } + + public function getExitCode() { + return $this->exitCode; + } + }