1
0
Fork 0

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

pull/6779/merge
Mihai Plasoianu 2017-10-11 17:12:40 +02:00 committed by Jordi Boggiano
parent 71c2ecbace
commit 02b57ff4a2
1 changed files with 6 additions and 1 deletions

View File

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