Fix run.sh: always run pip install, not only on venv creation

Existing .venv without packages caused ModuleNotFoundError. pip install
is a no-op when everything is already up to date, so always running it
is safe and ensures deps are present.

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

7
run.sh
View file

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