Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/updater.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/UpdateCommand.php')
-rw-r--r--lib/UpdateCommand.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/UpdateCommand.php b/lib/UpdateCommand.php
index 1d54a9b..c3b0c38 100644
--- a/lib/UpdateCommand.php
+++ b/lib/UpdateCommand.php
@@ -63,15 +63,19 @@ class UpdateCommand extends Command {
->addOption('no-backup', null, InputOption::VALUE_NONE, 'Skip backup of current Nextcloud version');
}
- protected function execute(InputInterface $input, OutputInterface $output) {
- $this->skipBackup = $input->getOption('no-backup');
-
+ public static function getUpdaterVersion(): string {
if (class_exists('NC\Updater\Version')) {
$versionClass = new Version();
- $version = $versionClass->get();
+ return $versionClass->get();
} else {
- $version = 'directly run from git checkout';
+ return 'git';
}
+ }
+
+ protected function execute(InputInterface $input, OutputInterface $output) {
+ $this->skipBackup = $input->getOption('no-backup');
+
+ $version = static::getUpdaterVersion();
$output->writeln('Nextcloud Updater - version: ' . $version);
$output->writeln('');