Skip to content

Commit e930853

Browse files
authored
Merge pull request #26607 from nextcloud/backport/26252/stable21
[stable21] Add force option to app install command
2 parents c580dd5 + 0f64b7c commit e930853

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

core/Command/App/Install.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,18 @@ protected function configure() {
5050
InputOption::VALUE_NONE,
5151
'don\'t enable the app afterwards'
5252
)
53+
->addOption(
54+
'force',
55+
'f',
56+
InputOption::VALUE_NONE,
57+
'install the app regardless of the Nextcloud version requirement'
58+
)
5359
;
5460
}
5561

5662
protected function execute(InputInterface $input, OutputInterface $output): int {
5763
$appId = $input->getArgument('app-id');
64+
$forceEnable = (bool) $input->getOption('force');
5865

5966
if (\OC_App::getAppPath($appId)) {
6067
$output->writeln($appId . ' already installed');
@@ -65,7 +72,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6572
/** @var Installer $installer */
6673
$installer = \OC::$server->query(Installer::class);
6774
$installer->downloadApp($appId);
68-
$result = $installer->installApp($appId);
75+
$result = $installer->installApp($appId, $forceEnable);
6976
} catch (\Exception $e) {
7077
$output->writeln('Error: ' . $e->getMessage());
7178
return 1;

0 commit comments

Comments
 (0)