1
0
Fork 0

disable path if no composer available, fixes #4101

gracefully remove the option and continue, after informing the user
pull/4111/head
Rob Bast 2015-06-05 13:00:04 +02:00
parent 8c81ec0d0e
commit 7a50225389
1 changed files with 6 additions and 0 deletions

View File

@ -197,6 +197,12 @@ EOT
} }
$writePath = !$input->getOption('name-only') && $input->getOption('path'); $writePath = !$input->getOption('name-only') && $input->getOption('path');
if ($writePath && null === $composer) {
$this->getIO()->writeError('No composer.json found in the current directory, disabling "path" option');
$writePath = false;
}
$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);
foreach ($packages[$type] as $package) { foreach ($packages[$type] as $package) {