Return non-zero exit code with --strict and single package

main
Mihai Plasoianu 7 years ago committed by Jordi Boggiano
parent 71c2ecbace
commit 02b57ff4a2

@ -43,6 +43,7 @@ use Composer\Semver\Semver;
* @author Robert Schönthal <seroscho@googlemail.com> * @author Robert Schönthal <seroscho@googlemail.com>
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
* @author Jérémy Romey <jeremyFreeAgent> * @author Jérémy Romey <jeremyFreeAgent>
* @author Mihai Plasoianu <mihai@plasoianu.de>
*/ */
class ShowCommand extends BaseCommand class ShowCommand extends BaseCommand
{ {
@ -196,9 +197,13 @@ EOT
$this->displayPackageTree($package, $installedRepo, $repos); $this->displayPackageTree($package, $installedRepo, $repos);
} else { } else {
$latestPackage = null; $latestPackage = null;
$exitCode = 0;
if ($input->getOption('latest')) { if ($input->getOption('latest')) {
$latestPackage = $this->findLatestPackage($package, $composer, $phpVersion); $latestPackage = $this->findLatestPackage($package, $composer, $phpVersion);
} }
if ($input->getOption('outdated') && $input->getOption('strict') && $latestPackage && $latestPackage->getFullPrettyVersion() !== $package->getFullPrettyVersion() && !$latestPackage->isAbandoned()) {
$exitCode = 1;
}
$this->printMeta($package, $versions, $installedRepo, $latestPackage ?: null); $this->printMeta($package, $versions, $installedRepo, $latestPackage ?: null);
$this->printLinks($package, 'requires'); $this->printLinks($package, 'requires');
$this->printLinks($package, 'devRequires', 'requires (dev)'); $this->printLinks($package, 'devRequires', 'requires (dev)');
@ -213,7 +218,7 @@ EOT
$this->printLinks($package, 'replaces'); $this->printLinks($package, 'replaces');
} }
return; return $exitCode;
} }
// show tree view if requested // show tree view if requested

Loading…
Cancel
Save