fix(Apps): fix install command check on existing apps

- AppManager::isInstalled() is misleading, as it checks only whether it is
  enabled. But an app might not be present in some edge cases.
- AppManager::getAppPath() does however only check whether an app dir is
  present, independent of the enabled-state.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
pull/55395/head
Arthur Schiwon 4 months ago
parent b2c88632bd
commit e9a1d7fa0d
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
  1. 5
      core/Command/App/Install.php

@ -9,6 +9,7 @@ declare(strict_types=1);
namespace OC\Core\Command\App;
use OC\Installer;
use OCP\App\AppPathNotFoundException;
use OCP\App\IAppManager;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
@ -58,9 +59,11 @@ class Install extends Command {
$appId = $input->getArgument('app-id');
$forceEnable = (bool)$input->getOption('force');
if ($this->appManager->isEnabledForAnyone($appId)) {
try {
$this->appManager->getAppPath($appId);
$output->writeln($appId . ' already installed');
return 1;
} catch (AppPathNotFoundException) {
}
try {

Loading…
Cancel
Save