Add non-zero return codes when why-not finds a reason a package is not installable, or when why finds no reason it is there, fixes #11796
parent
7cb92a90c8
commit
754f2868fb
|
@ -133,6 +133,8 @@ abstract class BaseDependencyCommand extends BaseCommand
|
||||||
$renderTree = $input->getOption(self::OPTION_TREE);
|
$renderTree = $input->getOption(self::OPTION_TREE);
|
||||||
$recursive = $renderTree || $input->getOption(self::OPTION_RECURSIVE);
|
$recursive = $renderTree || $input->getOption(self::OPTION_RECURSIVE);
|
||||||
|
|
||||||
|
$return = $inverted ? 1 : 0;
|
||||||
|
|
||||||
// Resolve dependencies
|
// Resolve dependencies
|
||||||
$results = $installedRepo->getDependents($needles, $constraint, $inverted, $recursive);
|
$results = $installedRepo->getDependents($needles, $constraint, $inverted, $recursive);
|
||||||
if (empty($results)) {
|
if (empty($results)) {
|
||||||
|
@ -142,6 +144,7 @@ abstract class BaseDependencyCommand extends BaseCommand
|
||||||
$needle,
|
$needle,
|
||||||
$extra
|
$extra
|
||||||
));
|
));
|
||||||
|
$return = $inverted ? 0 : 1;
|
||||||
} elseif ($renderTree) {
|
} elseif ($renderTree) {
|
||||||
$this->initStyles($output);
|
$this->initStyles($output);
|
||||||
$root = $packages[0];
|
$root = $packages[0];
|
||||||
|
@ -171,7 +174,7 @@ abstract class BaseDependencyCommand extends BaseCommand
|
||||||
$this->getIO()->writeError('Not finding what you were looking for? Try calling `composer '.$composerCommand.' "'.$needle.':'.$textConstraint.'" --dry-run` to get another view on the problem.');
|
$this->getIO()->writeError('Not finding what you were looking for? Try calling `composer '.$composerCommand.' "'.$needle.':'.$textConstraint.'" --dry-run` to get another view on the problem.');
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue