Files
llm-intelligence/scripts/rebuild_historical_report.sh
phamnazage-jpg 98b9203302
Some checks failed
CI / go-test (push) Has been cancelled
CI / scripts-regression (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / docker-build (push) Has been cancelled
fix: preserve local env overrides in shell pipelines
2026-05-30 16:38:38 +08:00

23 lines
781 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"
if [[ $# -lt 1 ]]; then
echo "用法: scripts/rebuild_historical_report.sh YYYY-MM-DD" >&2
exit 1
fi
REPORT_DATE="$1"
shift || true
while IFS= read -r kv; do export "$kv"; done < <("$ROOT_DIR/scripts/load_project_env.sh" ".env.local")
while IFS= read -r kv; do key="${kv%%=*}"; [[ -n "$key" && -n "${!key:-}" ]] && continue; export "$kv"; done < <("$ROOT_DIR/scripts/load_project_env.sh" ".env")
REPORT_DATE="$REPORT_DATE" \
REPORT_RUN_KIND="historical_rebuild" \
REPORT_TRIGGER_SOURCE="rebuild_script" \
REPORT_IS_OFFICIAL_DAILY="false" \
go run -tags llm_script ./scripts/generate_daily_report.go ./scripts/official_import_signature_audit_query_lib.go "$@"