1
0
Fork 0

Merge pull request #4111 from alcohol/disable-path-when-composer-unavailable

disable path if no composer available, fixes #4101
pull/4051/merge
Jordi Boggiano 2015-06-05 12:16:41 +01:00
commit d3d3bb4698
1 changed files with 5 additions and 0 deletions

View File

@ -196,6 +196,11 @@ EOT
$width--; $width--;
} }
if ($input->getOption('path') && null === $composer) {
$this->getIO()->writeError('No composer.json found in the current directory, disabling "path" option');
$input->setOption('path', false);
}
$writePath = !$input->getOption('name-only') && $input->getOption('path'); $writePath = !$input->getOption('name-only') && $input->getOption('path');
$writeVersion = !$input->getOption('name-only') && !$input->getOption('path') && $showVersion && ($nameLength + $versionLength + 3 <= $width); $writeVersion = !$input->getOption('name-only') && !$input->getOption('path') && $showVersion && ($nameLength + $versionLength + 3 <= $width);
$writeDescription = !$input->getOption('name-only') && !$input->getOption('path') && ($nameLength + ($showVersion ? $versionLength : 0) + 24 <= $width); $writeDescription = !$input->getOption('name-only') && !$input->getOption('path') && ($nameLength + ($showVersion ? $versionLength : 0) + 24 <= $width);