Fix case insensitivity of remove command, fixes #5973
parent
d735524eb1
commit
01885777f3
|
@ -84,19 +84,19 @@ EOT
|
||||||
foreach (array('require', 'require-dev') as $linkType) {
|
foreach (array('require', 'require-dev') as $linkType) {
|
||||||
if (isset($composer[$linkType])) {
|
if (isset($composer[$linkType])) {
|
||||||
foreach ($composer[$linkType] as $name => $version) {
|
foreach ($composer[$linkType] as $name => $version) {
|
||||||
$composer[$linkType][strtolower($name)] = $version;
|
$composer[$linkType][strtolower($name)] = $name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($packages as $package) {
|
foreach ($packages as $package) {
|
||||||
if (isset($composer[$type][$package])) {
|
if (isset($composer[$type][$package])) {
|
||||||
$json->removeLink($type, $package);
|
$json->removeLink($type, $composer[$type][$package]);
|
||||||
} elseif (isset($composer[$altType][$package])) {
|
} elseif (isset($composer[$altType][$package])) {
|
||||||
$io->writeError('<warning>'.$package.' could not be found in '.$type.' but it is present in '.$altType.'</warning>');
|
$io->writeError('<warning>'.$composer[$altType][$package].' could not be found in '.$type.' but it is present in '.$altType.'</warning>');
|
||||||
if ($io->isInteractive()) {
|
if ($io->isInteractive()) {
|
||||||
if ($io->askConfirmation('Do you want to remove it from '.$altType.' [<comment>yes</comment>]? ', true)) {
|
if ($io->askConfirmation('Do you want to remove it from '.$altType.' [<comment>yes</comment>]? ', true)) {
|
||||||
$json->removeLink($altType, $package);
|
$json->removeLink($altType, $composer[$altType][$package]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue