summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/Command/App/Enable.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/Command/App/Enable.php b/core/Command/App/Enable.php
index c91e715e1fa..75833753170 100644
--- a/core/Command/App/Enable.php
+++ b/core/Command/App/Enable.php
@@ -26,6 +26,7 @@
namespace OC\Core\Command\App;
+use OC\Installer;
use OCP\App\AppPathNotFoundException;
use OCP\App\IAppManager;
use OCP\IGroup;
@@ -97,7 +98,17 @@ class Enable extends Command implements CompletionAwareInterface {
return $group->getDisplayName();
}, $groupIds);
+
try {
+ /** @var Installer $installer */
+ $installer = \OC::$server->query(Installer::class);
+
+ if (false === $installer->isDownloaded($appId)) {
+ $installer->downloadApp($appId);
+ }
+
+ $installer->installApp($appId);
+
if ($groupIds === []) {
$this->appManager->enableApp($appId);
$output->writeln($appId . ' enabled');