This commit is contained in:
ZhuJW
2026-04-22 13:35:40 +08:00
commit 26a7fdf6c0
40 changed files with 11602 additions and 0 deletions

31
dev-debug.sh Normal file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
PORT="${1:-5228}"
VENV_BIN="${SCRIPT_DIR}/venv/bin"
PYTHON="python3"
FLASK="flask"
if [[ -x "${VENV_BIN}/python" ]]; then
PYTHON="${VENV_BIN}/python"
fi
if [[ -x "${VENV_BIN}/flask" ]]; then
FLASK="${VENV_BIN}/flask"
fi
if [[ ! -x "${PYTHON}" ]]; then
echo "Python not found. Create or activate a venv under ${SCRIPT_DIR}/venv first." >&2
exit 1
fi
export PYTHONUNBUFFERED=1
export FLASK_ENV=development
if [[ -x "${FLASK}" ]]; then
exec "${FLASK}" --app run:app run --host 0.0.0.0 --port "${PORT}" --debug
fi
exec "${PYTHON}" -m flask --app run:app run --host 0.0.0.0 --port "${PORT}" --debug