summaryrefslogtreecommitdiffstats
path: root/apps/updatenotification/lib
diff options
context:
space:
mode:
authorTobia De Koninck <LEDfan@users.noreply.github.com>2018-08-27 12:17:22 +0200
committerTobia De Koninck <LEDfan@users.noreply.github.com>2018-08-27 12:17:22 +0200
commitd492b2c3998ddf0395acaac2572097447eb01586 (patch)
tree283826dd9bdd3bec97a40ea884c004288e8c9777 /apps/updatenotification/lib
parente87caedf7e0c650fa94726ec80059cfab89251d3 (diff)
downloadnextcloud-server-d492b2c3998ddf0395acaac2572097447eb01586.tar.gz
nextcloud-server-d492b2c3998ddf0395acaac2572097447eb01586.zip
Add summary with amount of updates
Signed-off-by: Tobia De Koninck <LEDfan@users.noreply.github.com>
Diffstat (limited to 'apps/updatenotification/lib')
-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;
}
}