Make remove command case insensitive, fixes #5754

main
Jordi Boggiano 8 years ago
parent 5ee22f25ba
commit f23cdf59e3

@ -61,6 +61,7 @@ EOT
protected function execute(InputInterface $input, OutputInterface $output)
{
$packages = $input->getArgument('packages');
$packages = array_map('strtolower', $packages);
$file = Factory::getComposerFile();
@ -78,6 +79,15 @@ EOT
$io->writeError('<warning>You are using the deprecated option "update-with-dependencies". This is now default behaviour. The --no-update-with-dependencies option can be used to remove a package without its dependencies.</warning>');
}
// make sure name checks are done case insensitively
foreach (array('require', 'require-dev') as $linkType) {
if (isset($composer[$linkType])) {
foreach ($composer[$linkType] as $name => $version) {
$composer[$linkType][strtolower($name)] = $version;
}
}
}
foreach ($packages as $package) {
if (isset($composer[$type][$package])) {
$json->removeLink($type, $package);

Loading…
Cancel
Save