diff --git a/lib/UpdateCommand.php b/lib/UpdateCommand.php index c3b0c381..9a438cd9 100644 --- a/lib/UpdateCommand.php +++ b/lib/UpdateCommand.php @@ -3,6 +3,8 @@ * @copyright Copyright (c) 2016 Morris Jobke * @copyright Copyright (c) 2017 Lukas Reschke * + * @author Thomas Citharel + * * @license GNU AGPL version 3 or any later version * * This program is free software: you can redistribute it and/or modify @@ -38,6 +40,8 @@ class UpdateCommand extends Command { /** @var bool */ protected $skipBackup = false; + protected bool $skipUpgrade = false; + /** @var array strings of text for stages of updater */ protected $checkTexts = [ 0 => '', @@ -60,7 +64,8 @@ protected function configure() { ->setName('update') ->setDescription('Updates the code of an Nextcloud instance') ->setHelp("This command fetches the latest code that is announced via the updater server and safely replaces the existing code with the new one.") - ->addOption('no-backup', null, InputOption::VALUE_NONE, 'Skip backup of current Nextcloud version'); + ->addOption('no-backup', null, InputOption::VALUE_NONE, 'Skip backup of current Nextcloud version') + ->addOption('no-upgrade', null, InputOption::VALUE_NONE, "Don't automatically run occ upgrade"); } public static function getUpdaterVersion(): string { @@ -74,6 +79,7 @@ public static function getUpdaterVersion(): string { protected function execute(InputInterface $input, OutputInterface $output) { $this->skipBackup = $input->getOption('no-backup'); + $this->skipUpgrade = $input->getOption('no-upgrade'); $version = static::getUpdaterVersion(); $output->writeln('Nextcloud Updater - version: ' . $version); @@ -278,6 +284,12 @@ protected function execute(InputInterface $input, OutputInterface $output) { $this->updater->log('[info] update of code successful.'); $output->writeln('Update of code successful.'); + if ($this->skipUpgrade) { + $output->writeln('Please now execute "./occ upgrade" to finish the upgrade.'); + $this->updater->log('[info] updater finished'); + return 0; + } + if ($input->isInteractive()) { $output->writeln(''); diff --git a/updater.phar b/updater.phar index 1aae4ea2..027d13f8 100755 Binary files a/updater.phar and b/updater.phar differ