Fix exit codes

This commit is contained in:
Niklas Keller
2016-03-23 21:58:26 +01:00
parent 6173b779e1
commit 93c94d1a9b
2 changed files with 9 additions and 1 deletions

View File

@@ -125,7 +125,13 @@ Amp\run(function () use ($command, $climate) {
};
try {
yield $command->execute($climate->arguments);
$exitCode = (yield $command->execute($climate->arguments));
if ($exitCode === null) {
$logger->warning("Invalid exit code: null, falling back to 0. Please consider reporting this as bug.");
}
exit($exitCode);
} catch (Throwable $e) {
$handler($e);
} catch (Exception $e) {

View File

@@ -57,6 +57,8 @@ class Setup implements Command {
/** @var Registration $registration */
$registration = (yield $acme->register($email));
$this->climate->whisper("Registration successful with the following contact information: " . implode(", ", $registration->getContact()));
return 0;
}
private function checkEmail($email) {