-
-
Save wffranco/e6974f80ed4703ff45c540637a2c66a5 to your computer and use it in GitHub Desktop.
Sail local command for laravel with php 8.3. It will run automatically the first `composer` installation if `vendor` folder is missing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| cd "$(dirname "${BASH_SOURCE[0]}")" | |
| #if the command is called with `init` param, or `vendor` folder is missing | |
| if [ "$1" = "init" ] || [ ! -d vendor ]; then | |
| #run laravel sail container to run `composer install` | |
| docker run --rm \ | |
| -u "$(id -u):$(id -g)" \ | |
| -v $(pwd):/var/www/html \ | |
| -w /var/www/html \ | |
| laravelsail/php81-composer:latest \ | |
| composer install --ignore-platform-reqs | |
| fi | |
| if [ "$1" != "init" ]; then | |
| ./vendor/bin/sail $@ | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment