From 6dfe3c91d5fe1e363371ffadaf10706e23ffd5b6 Mon Sep 17 00:00:00 2001 From: Git'Fellow <12234510+solracsf@users.noreply.github.com> Date: Wed, 20 Sep 2023 16:32:29 +0200 Subject: [PATCH] Add a return message for app updates trough occ Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Handle single and all apps Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> Rewrite logic Fix psalm Fix psalm Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com> --- core/Command/App/Update.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/Command/App/Update.php b/core/Command/App/Update.php index c089416744f49..c8e62cb5b71c3 100644 --- a/core/Command/App/Update.php +++ b/core/Command/App/Update.php @@ -77,6 +77,7 @@ protected function configure(): void { protected function execute(InputInterface $input, OutputInterface $output): int { $singleAppId = $input->getArgument('app-id'); + $updateFound = false; if ($singleAppId) { $apps = [$singleAppId]; @@ -97,6 +98,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int foreach ($apps as $appId) { $newVersion = $this->installer->isUpdateAvailable($appId, $input->getOption('allow-unstable')); if ($newVersion) { + $updateFound = true; $output->writeln($appId . ' new version available: ' . $newVersion); if (!$input->getOption('showonly')) { @@ -122,6 +124,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int } } + if (!$updateFound) { + if ($singleAppId) { + $output->writeln($singleAppId . ' is up-to-date or no updates could be found'); + } else { + $output->writeln('All apps are up-to-date or no updates could be found'); + } + } + return $return; } }