mirror of
https://github.com/Yannick7777/codeigniter-setup-script.git
synced 2025-06-25 21:55:33 +02:00
22 lines
366 B
Bash
Executable file
22 lines
366 B
Bash
Executable file
#!/bin/bash
|
|
|
|
if [[ "$(basename $(pwd))" == "laravel" ]]; then
|
|
cd ..
|
|
./switch-branch-migrate "$@"
|
|
cd laravel
|
|
exit
|
|
fi
|
|
|
|
branch_name=$1
|
|
|
|
cd laravel
|
|
|
|
if git show-ref --verify --quiet refs/heads/"$branch_name"; then
|
|
git checkout "$branch_name"
|
|
else
|
|
git checkout -b "$branch_name"
|
|
fi
|
|
|
|
cd ..
|
|
|
|
docker compose exec app php artisan migrate:fresh --seed
|