[5.1] Move copying .env.example to post-root-package-install #3398
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
post-create-project-cmd is executed only after post-install-cmd and this
could cause issue on the first installation (via composer
create-project) where environment is not prepared hence
php artisan optimize
would generatecompiled.php
.Current Behaviour
post-install-cmd
executephp artisan optimize
while.env
doesn't exist (env=production & debug=false).post-create-project-cmd
execute copying.env.example
and generate key.Expected Behaviour
post-root-package-cmd
copy.env.example
to.env
so we can have (env=local & debug=true).post-install-cmd
executephp artisan optimize
with correct.env
.post-create-project-cmd
generate key.Refer to https://getcomposer.org/doc/articles/scripts.md#command-events
Signed-off-by: crynobone crynobone@gmail.com