1
0
Fork 0

Output a hint that maybe you are not in the right directory, fixes #8404

pull/8406/head
Jordi Boggiano 2019-11-01 16:32:34 +01:00
parent 149250ab92
commit af86ca1fb3
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 9 additions and 1 deletions

View File

@ -139,7 +139,15 @@ EOT
} }
$phpVersion = $this->repos->findPackage('php', '*')->getPrettyVersion(); $phpVersion = $this->repos->findPackage('php', '*')->getPrettyVersion();
$requirements = $this->determineRequirements($input, $output, $input->getArgument('packages'), $phpVersion, $preferredStability, !$input->getOption('no-update')); try {
$requirements = $this->determineRequirements($input, $output, $input->getArgument('packages'), $phpVersion, $preferredStability, !$input->getOption('no-update'));
} catch (\Exception $e) {
if ($this->newlyCreated) {
throw new \RuntimeException('No composer.json present in the current directory, this may be the cause of the following exception.', 0, $e);
}
throw $e;
}
$requireKey = $input->getOption('dev') ? 'require-dev' : 'require'; $requireKey = $input->getOption('dev') ? 'require-dev' : 'require';
$removeKey = $input->getOption('dev') ? 'require' : 'require-dev'; $removeKey = $input->getOption('dev') ? 'require' : 'require-dev';