瀏覽代碼

Merge pull request #26252 from Maxopoly/master

Add force option to app install command
tags/v22.0.0beta1
John Molakvoæ 3 年之前
父節點
當前提交
b9907df702
No account linked to committer's email address
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8
    1
      core/Command/App/Install.php

+ 8
- 1
core/Command/App/Install.php 查看文件

@@ -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;

Loading…
取消
儲存