Check for non-platform requirements before warning that no deps are installed on show command, fixes #11760
parent
4a209b7d3d
commit
12ed21705d
|
@ -258,10 +258,18 @@ EOT
|
||||||
}, $packages))]);
|
}, $packages))]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$installedRepo->getPackages() && ($rootPkg->getRequires() || $rootPkg->getDevRequires())) {
|
if (!$installedRepo->getPackages()) {
|
||||||
|
$hasNonPlatformReqs = static function (array $reqs): bool {
|
||||||
|
return (bool) array_filter(array_keys($reqs), function (string $name) {
|
||||||
|
return !PlatformRepository::isPlatformPackage($name);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
if ($hasNonPlatformReqs($rootPkg->getRequires()) || $hasNonPlatformReqs($rootPkg->getDevRequires())) {
|
||||||
$io->writeError('<warning>No dependencies installed. Try running composer install or update.</warning>');
|
$io->writeError('<warning>No dependencies installed. Try running composer install or update.</warning>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($composer) {
|
if ($composer) {
|
||||||
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'show', $input, $output);
|
$commandEvent = new CommandEvent(PluginEvents::COMMAND, 'show', $input, $output);
|
||||||
|
|
Loading…
Reference in New Issue