diff --git a/bin/acme b/bin/acme index 3424a11..7e21837 100755 --- a/bin/acme +++ b/bin/acme @@ -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) { diff --git a/src/Commands/Setup.php b/src/Commands/Setup.php index 40df5ec..da55ff7 100644 --- a/src/Commands/Setup.php +++ b/src/Commands/Setup.php @@ -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) {