1
0
Fork 0

Fix install step at the end of init command

pull/9848/head^2
Jordi Boggiano 2021-04-20 22:00:01 +02:00
parent 9ed241c809
commit 2a50a9400f
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 6 additions and 5 deletions

View File

@ -157,7 +157,7 @@ EOT
$question = 'Would you like to install dependencies now [<comment>yes</comment>]? '; $question = 'Would you like to install dependencies now [<comment>yes</comment>]? ';
if ($input->isInteractive() && $this->hasDependencies($options) && $io->askConfirmation($question)) { if ($input->isInteractive() && $this->hasDependencies($options) && $io->askConfirmation($question)) {
$this->installDependencies($output); $this->updateDependencies($output);
} }
return 0; return 0;
@ -837,13 +837,14 @@ EOT
return array_keys(array_slice($similarPackages, 0, 5)); return array_keys(array_slice($similarPackages, 0, 5));
} }
private function installDependencies($output) private function updateDependencies($output)
{ {
try { try {
$installCommand = $this->getApplication()->find('install'); $updateCommand = $this->getApplication()->find('update');
$installCommand->run(new ArrayInput(array()), $output); $this->getApplication()->resetComposer();
$updateCommand->run(new ArrayInput(array()), $output);
} catch (\Exception $e) { } catch (\Exception $e) {
$this->getIO()->writeError('Could not install dependencies. Run `composer install` to see more information.'); $this->getIO()->writeError('Could not update dependencies. Run `composer update` to see more information.');
} }
} }