Skip to content
Snippets Groups Projects
Unverified Commit e9308534 authored by Morris Jobke's avatar Morris Jobke Committed by GitHub
Browse files

Merge pull request #26607 from nextcloud/backport/26252/stable21

[stable21] Add force option to app install command
parents c580dd5f 0f64b7cd
No related branches found
No related tags found
No related merge requests found
......@@ -50,11 +50,18 @@ class Install extends Command {
InputOption::VALUE_NONE,
'don\'t enable the app afterwards'
)
->addOption(
'force',
'f',
InputOption::VALUE_NONE,
'install the app regardless of the Nextcloud version requirement'
)
;
}
protected function execute(InputInterface $input, OutputInterface $output): int {
$appId = $input->getArgument('app-id');
$forceEnable = (bool) $input->getOption('force');
if (\OC_App::getAppPath($appId)) {
$output->writeln($appId . ' already installed');
......@@ -65,7 +72,7 @@ class Install extends Command {
/** @var Installer $installer */
$installer = \OC::$server->query(Installer::class);
$installer->downloadApp($appId);
$result = $installer->installApp($appId);
$result = $installer->installApp($appId, $forceEnable);
} catch (\Exception $e) {
$output->writeln('Error: ' . $e->getMessage());
return 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment