diff options
Diffstat (limited to 'core/Command/App/Enable.php')
-rw-r--r-- | core/Command/App/Enable.php | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/core/Command/App/Enable.php b/core/Command/App/Enable.php index 5366230b841..3936acfbf6e 100644 --- a/core/Command/App/Enable.php +++ b/core/Command/App/Enable.php @@ -27,6 +27,7 @@ class Enable extends Command implements CompletionAwareInterface { public function __construct( protected IAppManager $appManager, protected IGroupManager $groupManager, + private Installer $installer, ) { parent::__construct(); } @@ -77,20 +78,17 @@ class Enable extends Command implements CompletionAwareInterface { return $group->getDisplayName(); }, $groupIds); - if ($this->appManager->isInstalled($appId) && $groupIds === []) { + if ($this->appManager->isEnabledForUser($appId) && $groupIds === []) { $output->writeln($appId . ' already enabled'); return; } try { - /** @var Installer $installer */ - $installer = \OC::$server->query(Installer::class); - - if ($installer->isDownloaded($appId) === false) { - $installer->downloadApp($appId); + if ($this->installer->isDownloaded($appId) === false) { + $this->installer->downloadApp($appId); } - $installer->installApp($appId, $forceEnable); + $this->installer->installApp($appId, $forceEnable); $appVersion = $this->appManager->getAppVersion($appId); if ($groupIds === []) { |