-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·38 lines (28 loc) · 772 Bytes
/
Copy pathdev.sh
File metadata and controls
executable file
·38 lines (28 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Check for Java
if ! command -v java &> /dev/null; then
echo "Error: Java is not installed or not in the PATH."
exit 1
fi
# Check for Bun
if ! command -v bun &> /dev/null; then
echo "Error: Bun is not installed or not in the PATH."
exit 1
fi
echo "Starting Backend (Spring Boot)..."
cd backend || exit
./gradlew bootRun &
BACKEND_PID=$!
echo "Starting Frontend (Vite)..."
cd ../frontend || exit
echo "Installing frontend dependencies if needed..."
bun install
bun dev &
FRONTEND_PID=$!
cd ..
echo "Development servers started!"
echo "Press Ctrl+C to stop both."
# Catch Ctrl+C and kill both processes
trap "echo 'Stopping servers...'; kill $BACKEND_PID $FRONTEND_PID; exit" INT TERM EXIT
# Wait indefinitely for background jobs
wait