Skip to content
Merged
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
Add force option to app install command
Signed-off-by: Maxopoly <[email protected]>
  • Loading branch information
Maxopoly authored and backportbot[bot] committed Apr 17, 2021
commit 0f64b7cd0d01e218d12c2d1c9b900c78c2105a0b
9 changes: 8 additions & 1 deletion core/Command/App/Install.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,18 @@ protected function configure() {
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');
Expand All @@ -65,7 +72,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
/** @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;
Expand Down