Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2019-01-27 23:53:09 +0300
committerDaniel Kesselberg <mail@danielkesselberg.de>2019-02-19 23:03:06 +0300
commit75b7d6ae4e13c62cc26c47122a6913159d7f6bc8 (patch)
tree9b60bd4884805e3baf7b21578b932fceac5057c0 /core/Command
parent76b5f44f05f3ea9f56707ed0f6c4bff2fa7673e8 (diff)
Add install logic for enable command
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'core/Command')
-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');