source it
This commit is contained in:
parent
3cf3770bea
commit
811c6d45b4
39
helper
39
helper
@ -1,17 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ "$1" == "composer" ]]; then
|
||||
docker compose run --rm composer composer "${@:2}"
|
||||
elif [[ "$1" == "fix_storage" ]]; then
|
||||
# Function to handle PHP Artisan commands
|
||||
php() {
|
||||
if [[ "$1" == "artisan" ]]; then
|
||||
docker compose exec fpm php artisan "${@:2}"
|
||||
else
|
||||
echo "Unknown php command"
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to handle Composer commands
|
||||
composer() {
|
||||
docker compose run --rm composer composer "${@}"
|
||||
}
|
||||
|
||||
# Function to handle MySQL commands
|
||||
mysql() {
|
||||
docker compose exec database "$@"
|
||||
}
|
||||
|
||||
# Function to fix storage permissions
|
||||
fix_storage() {
|
||||
docker compose exec fpm chown -R www-data:www-data storage/
|
||||
docker compose exec fpm chmod -R ug+rw storage
|
||||
docker compose exec fpm chmod -R ug+x storage/framework storage/logs
|
||||
docker compose exec fpm chmod -R ug+rw bootstrap/cache
|
||||
docker compose exec fpm chmod -R ug+x bootstrap/cache
|
||||
elif [[ "$1" == "mysql" ]]; then
|
||||
docker compose exec database "$@"
|
||||
elif [[ "$1" == "init" ]]; then
|
||||
cat <<EOL > compose.yml
|
||||
}
|
||||
|
||||
# Function to initialize the composer.yml file
|
||||
init() {
|
||||
cat <<EOL > composer.yml
|
||||
services:
|
||||
fpm:
|
||||
hostname: fpm
|
||||
@ -43,7 +62,5 @@ services:
|
||||
volumes:
|
||||
- ./.db:/var/lib/mysql
|
||||
EOL
|
||||
echo "compose.yml file created successfully!"
|
||||
else
|
||||
docker compose exec fpm "$@"
|
||||
fi
|
||||
echo "composer.yml file created successfully!"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user