-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlaunch_tengu.sh
More file actions
executable file
·53 lines (40 loc) · 1.72 KB
/
Copy pathlaunch_tengu.sh
File metadata and controls
executable file
·53 lines (40 loc) · 1.72 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env bash
set -e
# Resolve project root (directory of this script)
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BACKEND_VENV="$ROOT_DIR/backend/.venv/bin/activate"
BACKEND_CMD="cd \"$ROOT_DIR\" && source backend/.venv/bin/activate && uvicorn backend.app.main:app --reload --host 0.0.0.0 --port 8000"
FRONTEND_CMD="cd \"$ROOT_DIR\" && npm run dev"
APP_URL="http://localhost:8080"
# Sanity checks
if [ ! -f "$BACKEND_VENV" ]; then
echo "[Tengu Forge] Backend venv not found at:"
echo " $BACKEND_VENV"
echo "Create it first: cd backend && python -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt"
exit 1
fi
if ! command -v gnome-terminal >/dev/null 2>&1; then
echo "[Tengu Forge] gnome-terminal not found."
echo "Install it or edit launch_tengu.sh to use your preferred terminal (e.g. xterm, konsole, kitty)."
exit 1
fi
echo "[Tengu Forge] Launching backend..."
gnome-terminal -- bash -lc "$BACKEND_CMD"
sleep 1
echo "[Tengu Forge] Launching frontend..."
gnome-terminal -- bash -lc "$FRONTEND_CMD"
# Give the frontend a moment to boot
sleep 3
echo "[Tengu Forge] Launching app window at $APP_URL ..."
# Prefer a standalone "app" window instead of default browser
if command -v google-chrome >/dev/null 2>&1; then
google-chrome --app="$APP_URL" >/dev/null 2>&1 &
elif command -v chromium >/dev/null 2>&1; then
chromium --app="$APP_URL" >/dev/null 2>&1 &
elif command -v chromium-browser >/dev/null 2>&1; then
chromium-browser --app="$APP_URL" >/dev/null 2>&1 &
else
echo "[Tengu Forge] No Chrome/Chromium found; falling back to system default browser."
xdg-open "$APP_URL" >/dev/null 2>&1 &
fi
echo "[Tengu Forge] Launcher done. Backend + frontend should now be running."