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:
authorblizzz <blizzz@arthur-schiwon.de>2022-09-02 23:37:00 +0300
committerGitHub <noreply@github.com>2022-09-02 23:37:00 +0300
commit344fa3f9827d791ebc2c0a0d8bb19dd18da3b67a (patch)
tree84d63a56478e06fbbb33dc6afe45a52af829655a
parent121af7e14845a10093ba9e9fafea63cd01a67daf (diff)
parentf3e2bcd82eb1c0c1990c68baebd84dfa24e6d924 (diff)
Fix --version option
-rw-r--r--.gitignore3
-rw-r--r--lib/CommandApplication.php4
-rw-r--r--lib/UpdateCommand.php14
-rwxr-xr-xupdater.pharbin788795 -> 788986 bytes
4 files changed, 15 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index f7ead8c..c7c6032 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,5 @@ tests/data
tests/vendor
vendor/symfony/console/Tests
vendor/symfony/debug/Tests
-/vendor-bin/**/vendor \ No newline at end of file
+/vendor-bin/**/vendor
+.php-cs-fixer.cache
diff --git a/lib/CommandApplication.php b/lib/CommandApplication.php
index e1ad2de..563cfa0 100644
--- a/lib/CommandApplication.php
+++ b/lib/CommandApplication.php
@@ -32,6 +32,10 @@ use Symfony\Component\Console\Input\InputInterface;
* @package NC\Updater
*/
class CommandApplication extends Application {
+ public function __construct(string $name = 'update') {
+ parent::__construct($name, UpdateCommand::getUpdaterVersion());
+ }
+
/**
* Gets the name of the command based on input.
*
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('');
diff --git a/updater.phar b/updater.phar
index c0a1991..a7d9781 100755
--- a/updater.phar
+++ b/updater.phar
Binary files differ