Fix exit codes
This commit is contained in:
8
bin/acme
8
bin/acme
@@ -125,7 +125,13 @@ Amp\run(function () use ($command, $climate) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
try {
|
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) {
|
} catch (Throwable $e) {
|
||||||
$handler($e);
|
$handler($e);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ class Setup implements Command {
|
|||||||
/** @var Registration $registration */
|
/** @var Registration $registration */
|
||||||
$registration = (yield $acme->register($email));
|
$registration = (yield $acme->register($email));
|
||||||
$this->climate->whisper("Registration successful with the following contact information: " . implode(", ", $registration->getContact()));
|
$this->climate->whisper("Registration successful with the following contact information: " . implode(", ", $registration->getContact()));
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function checkEmail($email) {
|
private function checkEmail($email) {
|
||||||
|
|||||||
Reference in New Issue
Block a user