codeigniter-setup-script/switch-branch-migrate
2025-04-16 13:37:34 +02:00

26 lines
438 B
Bash
Executable file

#!/bin/bash
if [[ "$(basename $(pwd))" == "igniter" ]]; then
cd ..
./switch-branch-migrate "$@"
cd igniter
exit
fi
branch_name=$1
cd igniter
if git show-ref --verify --quiet refs/heads/"$branch_name"; then
git checkout "$branch_name"
else
git checkout -b "$branch_name"
fi
cd ..
seeds=$(ls igniter/Seeds)
docker compose exec app php spark migrate
docker compose exec app php spark db:seed App &> /dev/null