Load project .env from backend run script

This commit is contained in:
ycw_vm 2026-03-10 19:46:12 +08:00 committed by Star
parent f321ee6f52
commit 88160bd755

View file

@ -1,4 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# Auto-load project env file when present.
if [[ -f "$ROOT_DIR/.env" ]]; then
set -a
# shellcheck disable=SC1091
source "$ROOT_DIR/.env"
set +a
fi
exec "$ROOT_DIR/.venv/bin/python" "$ROOT_DIR/backend/app.py"