Add run.sh to handle venv setup automatically

Creates .venv on first run, installs dependencies, then starts the server.
Subsequent runs skip straight to starting. Avoids externally-managed-environment
errors on Debian/Ubuntu 12+.

https://claude.ai/code/session_01JuRTR5Xjx8emQsyerBgGU7
This commit is contained in:
Claude 2026-05-30 11:42:48 +00:00
parent a5c9af1ca6
commit 8fa3aca85d
No known key found for this signature in database

15
run.sh Normal file
View file

@ -0,0 +1,15 @@
#!/bin/bash
# Run ClubLedger creates a virtualenv on first run, then starts the server.
set -e
VENV=".venv"
if [ ! -d "$VENV" ]; then
echo "Creating virtual environment..."
python3 -m venv "$VENV"
echo "Installing dependencies..."
"$VENV/bin/pip" install --quiet -r requirements.txt
echo "Done."
fi
exec "$VENV/bin/python" main.py "$@"