Skip to content

Commit

Permalink
Change "is plugin uninstalled?" check to always run
Browse files Browse the repository at this point in the history
Previously the check would only run if the plugin was require-dev.
That behaviour is incorrect, as the check should always be done.
If the plugin is not installed, it doesn't make sense to return an
error under any circumstances.

This commit fixes that oversight.
  • Loading branch information
Potherca committed Jan 26, 2020
1 parent dc6d0e2 commit 8a008d5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ public function onDependenciesChangedEvent()
$io->write(sprintf('<info>%s</info>', self::MESSAGE_NOTHING_TO_INSTALL));
}
} else {
$isDev = array_key_exists(self::PLUGIN_NAME, $this->composer->getPackage()->getDevRequires());

$pluginPackage = $this
->composer
->getRepositoryManager()
Expand All @@ -196,7 +194,7 @@ public function onDependenciesChangedEvent()

$isPluginUninstalled = count($pluginPackage) === 0;

if ($isDev && $isPluginUninstalled) {
if ($isPluginUninstalled) {
if ($isVerbose) {
$io->write(sprintf('<info>%s</info>', self::MESSAGE_PLUGIN_UNINSTALLED));
}
Expand Down

0 comments on commit 8a008d5

Please sign in to comment.