From 583dd1d52b87edcb2220066fff5db452c38c883e Mon Sep 17 00:00:00 2001 From: zichun Date: Thu, 30 Apr 2026 09:19:15 +0800 Subject: [PATCH] chore(infra): source .env.local in scripts/test.sh for pre-push hook --- scripts/test.sh | 5 +++++ 1 file changed, 5 insertions(+), 0 deletions(-) diff --git a/scripts/test.sh b/scripts/test.sh index dbe8d3d..4674205 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -8,6 +8,11 @@ set -euo pipefail PROJECT_ROOT="$(cd "$(dirname "$0")/.." && pwd)" cd "$PROJECT_ROOT" +# 加载 .env.local(DB_HOST/DB_PORT/JWT_SECRET 等),让 mvn / setup-test-db.sh 都能读到 +if [ -f .env.local ]; then + set -a; . ./.env.local; set +a +fi + echo "[test.sh] 1/6 setup test db" ./scripts/setup-test-db.sh -- libgit2 0.22.2