diff --git a/CHANGELOG.md b/CHANGELOG.md index d7d3144630c..90c9207e108 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ The Product Changelog at **[matomo.org/changelog](https://matomo.org/changelog)* ### New commands -* New command `plugin:install` lets you install a plugin from the Marketplace. +* New command `plugin:install-or-update` lets you install or update a plugin from the Marketplace. ## Matomo 5.1.0 diff --git a/plugins/CorePluginsAdmin/Commands/InstallPlugin.php b/plugins/CorePluginsAdmin/Commands/InstallPlugin.php index 1fae52e28e3..2527598808b 100644 --- a/plugins/CorePluginsAdmin/Commands/InstallPlugin.php +++ b/plugins/CorePluginsAdmin/Commands/InstallPlugin.php @@ -23,9 +23,9 @@ class InstallPlugin extends ConsoleCommand { protected function configure(): void { - $this->setName('plugin:install'); - $this->setDescription('Install a plugin.'); - $this->addOptionalArgument('plugin', 'The plugin name you want to install. Multiple plugin names can be specified separated by a space.', null, true); + $this->setName('plugin:install-or-update'); + $this->setDescription('Install or update a plugin.'); + $this->addOptionalArgument('plugin', 'The name of the plugin you want to install or update. Multiple plugin names can be specified separated by a space.', null, true); } protected function doExecute(): int @@ -37,18 +37,13 @@ protected function doExecute(): int $pluginManager = Manager::getInstance(); if (!Marketplace::isMarketplaceEnabled()) { - $output->writeln(sprintf("Marketplace is not enabled, can't install plugins.")); + $output->writeln(sprintf("Marketplace is not enabled, can't install or update plugins.")); return self::FAILURE; } $pluginNames = $input->getArgument('plugin'); foreach ($pluginNames as $pluginName) { - if ($pluginManager->isPluginInstalled($pluginName)) { - $output->writeln(sprintf('The plugin %s is already installed.', $pluginName)); - continue; - } - try { $this->installPlugin($pluginName); $output->writeln(sprintf("Installed plugin %s", $pluginName));