Detect if no .env file exists and add it on composer commands.

This commit is contained in:
Dean Householder
2020-01-06 10:55:34 -07:00
parent 50957fc179
commit 353c2479f1

View File

@ -53,11 +53,20 @@
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"initial-setup": [
"test -f .env || (cp .env.example .env; php artisan key:generate 2>/dev/null; exit 0)"
],
"pre-install-cmd": [
"@initial-setup"
],
"pre-update-cmd": [
"@initial-setup"
],
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
"@initial-setup"
],
"post-create-project-cmd": [
"php artisan key:generate --ansi"
"@initial-setup"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",