Created
April 7, 2022 11:43
-
-
Save MarceloHoffmeister/5517f7789b0a02e1a800cd758884b212 to your computer and use it in GitHub Desktop.
Dartisan
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
#!/bin/bash | |
# name of PHP container | |
CONTAINER_PHP="some-container" | |
# PHP version | |
PHP_VERSAO=7.4 | |
PARAMS=$@ | |
if [[ $PARAMS == tinker* ]]; then | |
docker exec -ti $CONTAINER_PHP php artisan $PARAMS | |
elif [[ $PARAMS == make:* ]] || [[ $PARAMS == vendor:publish* ]] || [[ $PARAMS == datatable:make* ]]; then | |
docker run --rm --user $(id -u):$(id -g) -v $(pwd):/app -w /app -ti php:$PHP_VERSAO-cli php artisan $PARAMS | |
else | |
docker exec $CONTAINER_PHP php artisan $PARAMS | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment