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:
Diffstat (limited to 'core/Command/App/Enable.php')
-rw-r--r--core/Command/App/Enable.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/core/Command/App/Enable.php b/core/Command/App/Enable.php
index c4e2363def5..402d1b98acb 100644
--- a/core/Command/App/Enable.php
+++ b/core/Command/App/Enable.php
@@ -4,8 +4,9 @@
*
* @author Daniel Kesselberg <mail@danielkesselberg.de>
* @author Joas Schilling <coding@schilljs.com>
- * @author Morris Jobke <hey@morrisjobke.de>
+ * @author John Molakvoæ <skjnldsv@protonmail.com>
* @author Robin Appelman <robin@icewind.nl>
+ * @author Sander Ruitenbeek <s.ruitenbeek@getgoing.nl>
*
* @license AGPL-3.0
*
@@ -22,7 +23,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>
*
*/
-
namespace OC\Core\Command\App;
use OC\Installer;
@@ -82,7 +82,7 @@ class Enable extends Command implements CompletionAwareInterface {
);
}
- protected function execute(InputInterface $input, OutputInterface $output) {
+ protected function execute(InputInterface $input, OutputInterface $output): int {
$appIds = $input->getArgument('app-id');
$groups = $this->resolveGroupIds($input->getOption('groups'));
$forceEnable = (bool) $input->getOption('force');
@@ -105,6 +105,10 @@ class Enable extends Command implements CompletionAwareInterface {
return $group->getDisplayName();
}, $groupIds);
+ if ($this->appManager->isInstalled($appId) && $groupIds === []) {
+ $output->writeln($appId . ' already enabled');
+ return;
+ }
try {
/** @var Installer $installer */
@@ -115,13 +119,14 @@ class Enable extends Command implements CompletionAwareInterface {
}
$installer->installApp($appId, $forceEnable);
+ $appVersion = \OC_App::getAppVersion($appId);
if ($groupIds === []) {
$this->appManager->enableApp($appId, $forceEnable);
- $output->writeln($appId . ' enabled');
+ $output->writeln($appId . ' ' . $appVersion . ' enabled');
} else {
$this->appManager->enableAppForGroups($appId, $groupIds, $forceEnable);
- $output->writeln($appId . ' enabled for groups: ' . implode(', ', $groupNames));
+ $output->writeln($appId . ' ' . $appVersion . ' enabled for groups: ' . implode(', ', $groupNames));
}
} catch (AppPathNotFoundException $e) {
$output->writeln($appId . ' not found');