Repository navigation
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·68 lines (63 loc) · 1.83 KB
/
Copy pathrun.sh
File metadata and controls
executable file
·68 lines (63 loc) · 1.83 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env bash
# Unified launcher for VAB
# Usage:
# ./run.sh # production mode with pre-built UI
# ./run.sh --demo # demo mode with pre-built UI
# ./run.sh --dev-ui # production mode with Vite dev server (hot-reload)
# ./run.sh --demo --dev-ui # demo mode with Vite dev server
DEMO=false
DEV_UI=false
# Parse arguments
for arg in "$@"; do
case $arg in
--demo)
DEMO=true
shift
;;
--dev-ui)
DEV_UI=true
shift
;;
--help|-h)
echo "Usage: $0 [--demo] [--dev-ui]"
echo ""
echo "Options:"
echo " --demo Run in demo mode (mock data, no database)"
echo " --dev-ui Run with Vite dev server for UI development (requires ui/src/)"
echo ""
echo "Examples:"
echo " $0 # production mode with pre-built UI"
echo " $0 --demo # demo mode with pre-built UI"
echo " $0 --dev-ui # production mode with Vite dev server"
echo " $0 --demo --dev-ui # demo mode with Vite dev server"
exit 0
;;
*)
echo "Unknown option: $arg"
echo "Use --help for usage information"
exit 1
;;
esac
done
# Find Python executable
if [ -f ".venv/Scripts/python" ]; then
PYTHON=".venv/Scripts/python"
else
PYTHON=".venv/bin/python"
fi
# Build command
if [ "$DEV_UI" = true ]; then
# Use dev.py for Vite dev server
CMD=("$PYTHON" "dev.py")
if [ "$DEMO" = true ]; then
CMD+=("--demo")
fi
else
# Use vab.py server for pre-built UI
CMD=("$PYTHON" "vab.py" "server")
if [ "$DEMO" = true ]; then
CMD+=("--demo")
fi
fi
# Run
"${CMD[@]}"