From 526d8e53e099bd747d87a6d1aea4da5b6e5f0fdd Mon Sep 17 00:00:00 2001 From: artyuum Date: Fri, 21 Oct 2022 09:53:48 +0400 Subject: [PATCH 1/2] Add post create project command to remove composer.lock from .gitignore --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 665b5658e8..7aa1fecccd 100644 --- a/composer.json +++ b/composer.json @@ -109,6 +109,7 @@ "@auto-scripts" ], "post-create-project-cmd": [ + "@php -r \"file_put_contents('.gitignore', str_replace('/composer.lock', '', file_get_contents('.gitignore')));\"", "@php bin/console sylius:inform-about-gus --ansi", "@php bin/console sylius:show-available-plugins --ansi" ], From a4e65051cbe5819865c68de6db1755877523d5ea Mon Sep 17 00:00:00 2001 From: artyuum Date: Fri, 21 Oct 2022 10:24:29 +0400 Subject: [PATCH 2/2] Prevent blank line after removing composer.lock in .gitignore --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7aa1fecccd..80a26980ed 100644 --- a/composer.json +++ b/composer.json @@ -109,7 +109,7 @@ "@auto-scripts" ], "post-create-project-cmd": [ - "@php -r \"file_put_contents('.gitignore', str_replace('/composer.lock', '', file_get_contents('.gitignore')));\"", + "@php -r \"file_put_contents('.gitignore', str_replace('/composer.lock' . PHP_EOL, '', file_get_contents('.gitignore')));\"", "@php bin/console sylius:inform-about-gus --ansi", "@php bin/console sylius:show-available-plugins --ansi" ],