Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ tests/data
tests/vendor
vendor/symfony/console/Tests
vendor/symfony/debug/Tests
/vendor-bin/**/vendor
/vendor-bin/**/vendor
.php-cs-fixer.cache
4 changes: 4 additions & 0 deletions lib/CommandApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
* @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.
*
Expand Down
14 changes: 9 additions & 5 deletions lib/UpdateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,19 @@ protected function configure() {
->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('');

Expand Down
Binary file modified updater.phar
Binary file not shown.