chore: Bumps dependencies, rewrites development environment system.

This commit is contained in:
greysoh 2024-12-01 13:06:28 -05:00
parent c0a12f53d1
commit 0965c56547
Signed by: imterah
GPG key ID: 8FA7DD57BA6CEA37
12 changed files with 1146 additions and 1265 deletions

38
init.sh
View file

@ -1,5 +1,35 @@
pushd api > /dev/null 2> /dev/null
source init.sh
#!/usr/bin/env bash
owned_docker=1
git config --local include.path .gitconfig
popd > /dev/null 2> /dev/null
# Test if Postgres is up
lsof -i:5432 2> /dev/null > /dev/null
if [ $? -ne 0 ]; then
owned_docker=0
docker compose -f dev-docker-compose.yml up -d
fi
if [ ! -f "api/.env" ]; then
cp api/dev.env api/.env
fi
if [ ! -d "api/node_modules" ]; then
pushd api > /dev/null
npm install --save-dev
npx prisma migrate dev
popd > /dev/null
fi
source api/.env
on_exit() {
cd $(git rev-parse --show-toplevel)
if [ $owned_docker -ne 0 ]; then
return
fi
docker compose -f dev-docker-compose.yml down
}
trap "on_exit" exit