From 9ed241c8093d174269e33ecd241a081a0f4f7bee Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 19 Apr 2021 14:16:39 +0200 Subject: [PATCH 1/2] Use jsonc highlighting --- doc/articles/versions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/articles/versions.md b/doc/articles/versions.md index 67f2c2958..b1f71f0fc 100644 --- a/doc/articles/versions.md +++ b/doc/articles/versions.md @@ -214,7 +214,7 @@ setting. All available stability flags are listed on the minimum-stability section of the [schema page](../04-schema.md#minimum-stability). ## Summary -```json +```jsonc "require": { "vendor/package": "1.3.2", // exactly 1.3.2 From 2a50a9400f0525d9b16f367fa71856479bfee259 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 20 Apr 2021 22:00:01 +0200 Subject: [PATCH 2/2] Fix install step at the end of init command --- src/Composer/Command/InitCommand.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Composer/Command/InitCommand.php b/src/Composer/Command/InitCommand.php index 30e30dcfa..6c148d0f5 100644 --- a/src/Composer/Command/InitCommand.php +++ b/src/Composer/Command/InitCommand.php @@ -157,7 +157,7 @@ EOT $question = 'Would you like to install dependencies now [yes]? '; if ($input->isInteractive() && $this->hasDependencies($options) && $io->askConfirmation($question)) { - $this->installDependencies($output); + $this->updateDependencies($output); } return 0; @@ -837,13 +837,14 @@ EOT return array_keys(array_slice($similarPackages, 0, 5)); } - private function installDependencies($output) + private function updateDependencies($output) { try { - $installCommand = $this->getApplication()->find('install'); - $installCommand->run(new ArrayInput(array()), $output); + $updateCommand = $this->getApplication()->find('update'); + $this->getApplication()->resetComposer(); + $updateCommand->run(new ArrayInput(array()), $output); } 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.'); } }