Skip to content

Commit

Permalink
Detect if no .env file exists and add it on composer commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
deanhouseholder committed Jan 6, 2020
1 parent 50957fc commit 353c247
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 353c247

Please sign in to comment.