summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/updatenotification/lib/Command/Check.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/updatenotification/lib/Command/Check.php b/apps/updatenotification/lib/Command/Check.php
index c6109e44e6a..f363832873b 100644
--- a/apps/updatenotification/lib/Command/Check.php
+++ b/apps/updatenotification/lib/Command/Check.php
@@ -62,10 +62,13 @@ class Check extends Command {
}
protected function execute(InputInterface $input, OutputInterface $output) {
+ $updatesAvailableCount = 0;
+
// Server
$r = $this->updateChecker->getUpdateState();
if (isset($r['updateAvailable']) && $r['updateAvailable']) {
$output->writeln($r['updateVersion'] . ' is available. Get more information on how to update at '. $r['updateLink'] . '.');
+ $updatesAvailableCount += 1;
}
@@ -75,9 +78,19 @@ class Check extends Command {
$update = $this->installer->isUpdateAvailable($app);
if ($update !== false) {
$output->writeln('Update for ' . $app . ' to version ' . $update . ' is available.');
+ $updatesAvailableCount += 1;
}
}
+ // Report summary
+ if ($updatesAvailableCount === 0) {
+ $output->writeln('<info>Everything up to date</info>');
+ } else if ($updatesAvailableCount === 1) {
+ $output->writeln('<comment>1 update available</comment>');
+ } else {
+ $output->writeln('<comment>' . $updatesAvailableCount . ' updates available</comment>');
+ }
+
return 0;
}
}