add development and build scripts
This commit is contained in:
32
scripts/dev-all.sh
Executable file
32
scripts/dev-all.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
|
||||
cleanup() {
|
||||
if [[ -n "${BACKEND_PID:-}" ]]; then
|
||||
kill "$BACKEND_PID" 2>/dev/null || true
|
||||
fi
|
||||
if [[ -n "${WEB_PID:-}" ]]; then
|
||||
kill "$WEB_PID" 2>/dev/null || true
|
||||
fi
|
||||
}
|
||||
|
||||
trap cleanup EXIT INT TERM
|
||||
|
||||
echo "Starting backend API..."
|
||||
(
|
||||
cd "$ROOT_DIR/backend"
|
||||
go run ./cmd/api
|
||||
) &
|
||||
BACKEND_PID=$!
|
||||
|
||||
echo "Starting Svelte web client..."
|
||||
(
|
||||
cd "$ROOT_DIR/apps/web"
|
||||
npm run dev
|
||||
) &
|
||||
WEB_PID=$!
|
||||
|
||||
wait -n "$BACKEND_PID" "$WEB_PID"
|
||||
|
||||
Reference in New Issue
Block a user