forked from Dungeon-CampusMinden/Dungeon
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart_blockly.sh
More file actions
32 lines (26 loc) · 743 Bytes
/
Copy pathstart_blockly.sh
File metadata and controls
32 lines (26 loc) · 743 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
#!/bin/bash
# Kill background jobs when script exits
cleanup() {
echo "Stopping servers..."
kill $(jobs -p) 2>/dev/null
echo "All servers stopped."
}
trap cleanup EXIT
read -p "Web Version (yes/no)? " answer
if [[ "$answer" == "yes" || "$answer" == "y" ]]; then
echo "Starting Web Version..."
./gradlew runBlockly -Pweb=true &
gradle_pid=$!
echo "Starting Blockly frontend..."
cd blockly/frontend || exit
npm run dev &
npm_pid=$!
echo "Waiting 5 seconds before opening browser..."
sleep 5
xdg-open http://localhost:5173/ 2>/dev/null || open http://localhost:5173/
echo "Press CTRL+C to stop everything"
wait
else
echo "Starting Java Dungeon..."
./gradlew runBlockly
fi