1
0
Fork 0

Simplify code and fix path to composer.json, refs #6001

pull/6008/head
Jordi Boggiano 2016-12-28 19:00:22 +01:00
parent afdae9c0e2
commit ed0829fed1
1 changed files with 4 additions and 9 deletions

View File

@ -168,17 +168,12 @@ EOT
if (empty($package)) {
$options = $input->getOptions();
if (isset($options['working-dir'])) {
$composer_json = $options['working-dir'] . '/composer.json';
if (file_exists($composer_json)) {
$io->writeError('Package ' . $packageFilter . ' not found in ' . $composer_json);
return;
} else {
throw new \InvalidArgumentException('Package ' . $packageFilter . ' not found');
}
} else {
if (!isset($options['working-dir']) || !file_exists('composer.json')) {
throw new \InvalidArgumentException('Package ' . $packageFilter . ' not found');
}
$io->writeError('Package ' . $packageFilter . ' not found in ' . $options['working-dir'] . '/composer.json');
return;
}
} else {
$versions = array($package->getPrettyVersion() => $package->getVersion());