Skip to content

Commit afbb997

Browse files
committed
fix(run_local): make shellcheck clean (CI lint was red)
The CI lint job (shellcheck) failed on three info-level findings in run_local.sh (pre-existing since the run_engine rewrite): SC2030/SC2031 from re-exporting OPENROUTER_API_KEY inside run_engine's subshell, and SC2015 from the A && B && C || {…} precondition. Drop the redundant key re-export (it's inherited from the env) and rewrite the precondition as an if. shellcheck now passes.
1 parent 50d7444 commit afbb997

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

scripts/run_local.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ run_engine() {
6565
PROJECT_ROOT="$ENGINE" \
6666
DIAGRAM_DEPTH_LEVEL="$DEPTH" \
6767
CACHING_DOCUMENTATION="false" \
68-
ENABLE_MONITORING="false" \
69-
OPENROUTER_API_KEY="${OPENROUTER_API_KEY:-}"
68+
ENABLE_MONITORING="false"
69+
# OPENROUTER_API_KEY is inherited from the environment (full mode requires it).
7070
# Pass the model only when set; empty -> engine's own valid per-provider default.
7171
if [ -n "$AGENT_MODEL" ]; then export AGENT_MODEL; fi
7272
if [ -n "$PARSING_MODEL" ]; then export PARSING_MODEL; fi
@@ -78,8 +78,9 @@ if [ -n "$BASE_JSON" ] && [ -n "$HEAD_JSON" ]; then
7878
BASE_ANALYSIS="$BASE_JSON"
7979
HEAD_ANALYSIS="$HEAD_JSON"
8080
else
81-
[ -n "$REPO" ] && [ -n "$BASE_REF" ] && [ -n "$HEAD_REF" ] || {
82-
echo "Need either --base-json/--head-json, or --repo/--base/--head." >&2; exit 2; }
81+
if [ -z "$REPO" ] || [ -z "$BASE_REF" ] || [ -z "$HEAD_REF" ]; then
82+
echo "Need either --base-json/--head-json, or --repo/--base/--head." >&2; exit 2
83+
fi
8384
[ -d "$ENGINE" ] || { echo "Engine not found at $ENGINE (set --engine or \$ENGINE)." >&2; exit 2; }
8485
[ -n "${OPENROUTER_API_KEY:-}" ] || { echo "Export OPENROUTER_API_KEY for the full pipeline." >&2; exit 2; }
8586
REPO="$(cd "$REPO" && pwd)"

0 commit comments

Comments
 (0)