From: Joas Schilling Date: Tue, 3 Jan 2023 11:47:58 +0000 (+0100) Subject: Print output also with status code X-Git-Tag: v26.0.0beta1~146^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8e1f74235569a06d99507a7b7b309e48ff68c8f3;p=nextcloud-server.git Print output also with status code Signed-off-by: Joas Schilling --- diff --git a/core/Command/Status.php b/core/Command/Status.php index 9b3af59b94a..7e6e3502ada 100644 --- a/core/Command/Status.php +++ b/core/Command/Status.php @@ -59,15 +59,6 @@ class Status extends Base { protected function execute(InputInterface $input, OutputInterface $output): int { $maintenanceMode = $this->config->getSystemValueBool('maintenance', false); $needUpgrade = Util::needUpgrade(); - if ($input->getOption('exit-code')) { - if ($maintenanceMode === true) { - return 1; - } elseif ($needUpgrade == true) { - return 2; - } else { - return 0; - } - } $values = [ 'installed' => $this->config->getSystemValueBool('installed', false), 'version' => implode('.', Util::getVersion()), @@ -80,6 +71,14 @@ class Status extends Base { ]; $this->writeArrayInOutputFormat($input, $output, $values); + if ($input->getOption('exit-code')) { + if ($maintenanceMode === true) { + return 1; + } + if ($needUpgrade === true) { + return 2; + } + } return 0; } }