-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-macos.command
More file actions
executable file
·57 lines (48 loc) · 1.47 KB
/
Copy pathstart-macos.command
File metadata and controls
executable file
·57 lines (48 loc) · 1.47 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
#!/bin/sh
# PlotterForge — one-click launch (Metal/MPS).
# Double-click in Finder, or run: ./start-macos.command [--debug]
#
# Offline launcher: it never installs, syncs, builds, downloads, or kills
# processes. Run ./setup-macos.command first to prepare the environment.
cd "$(dirname "$0")" || exit 1
PORT=7438
DEBUG_MODE=0
if [ "$#" -gt 1 ]; then
echo "Usage: ./start-macos.command [--debug]" >&2
exit 2
fi
case "${1:-}" in
"") ;;
--debug) DEBUG_MODE=1 ;;
*)
echo "Usage: ./start-macos.command [--debug]" >&2
exit 2
;;
esac
unset CONDA_PREFIX CONDA_DEFAULT_ENV CONDA_PROMPT_MODIFIER CONDA_PYTHON_EXE CONDA_SHLVL
if [ ! -x ".venv/bin/python" ]; then
echo "Run ./setup-macos.command first." >&2
exit 1
fi
PIDS=$(lsof -nP -iTCP:$PORT -sTCP:LISTEN -t 2>/dev/null)
if [ -n "$PIDS" ]; then
echo "Port $PORT is already in use by PID $PIDS. Stop it and retry." >&2
exit 1
fi
echo "▸ Verifying environment…"
uv run --locked --no-sync python -m web.env_check --backend mps || exit 1
if [ "$DEBUG_MODE" -eq 1 ]; then
export PLOTTER_DEBUG_ACTIONS=1
export PLOTTER_LOG_LEVEL=DEBUG
export PLOTTER_LOG_FILE=1
echo ""
echo "▸ Debug recording enabled"
echo " Actions: ~/.plotterforge/logs/debug-actions-*.jsonl"
echo " Server: ~/.plotterforge/logs/plotter.log"
fi
echo ""
echo "▸ Starting PlotterForge (MPS)…"
echo " Local: http://localhost:$PORT"
echo " (Press Ctrl+C to stop.)"
echo ""
exec uv run --locked --no-sync python -m web.server