summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2023-01-03 12:47:58 +0100
committerJoas Schilling <coding@schilljs.com>2023-01-03 12:47:58 +0100
commit8e1f74235569a06d99507a7b7b309e48ff68c8f3 (patch)
tree122e5361d3911adee059731bfd0a9dd93c0d6f26 /core
parentfba906e34a35ab31a334421edacdd7d4d29b1d7f (diff)
downloadnextcloud-server-8e1f74235569a06d99507a7b7b309e48ff68c8f3.tar.gz
nextcloud-server-8e1f74235569a06d99507a7b7b309e48ff68c8f3.zip
Print output also with status code
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'core')
-rw-r--r--core/Command/Status.php17
1 files changed, 8 insertions, 9 deletions
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;
}
}