summaryrefslogtreecommitdiffstats
path: root/core/Command/App
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2019-01-27 21:53:09 +0100
committerDaniel Kesselberg <mail@danielkesselberg.de>2019-02-19 21:03:06 +0100
commit75b7d6ae4e13c62cc26c47122a6913159d7f6bc8 (patch)
tree9b60bd4884805e3baf7b21578b932fceac5057c0 /core/Command/App
parent76b5f44f05f3ea9f56707ed0f6c4bff2fa7673e8 (diff)
downloadnextcloud-server-75b7d6ae4e13c62cc26c47122a6913159d7f6bc8.tar.gz
nextcloud-server-75b7d6ae4e13c62cc26c47122a6913159d7f6bc8.zip
Add install logic for enable command
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'core/Command/App')
-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');