From 550e702b7aa5631201a2ea86e9120a564b443475 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Sun, 22 Nov 2026 14:28:52 +0100 Subject: [PATCH] Fix deploy exit 1 after PASS (RETURN trap) sync_mcp_venv runs in the main shell, so its RETURN trap outlived the function and fired again when main returned, with $log unset: set -u turned a passing deploy into exit 1. Remove the temp log explicitly. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01WzxdWWuLpGVY9MnowhTNcM --- scripts/deploy.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 6098b7e..9948c3d 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -65,11 +65,15 @@ preflight() { sync_mcp_venv() { local log log="$(mktemp)" - trap 'rm -f "$log"' RETURN + # No RETURN trap: this runs in the main shell (not a $(...) like + # sync_units), where the trap outlives the function and later fires + # with $log unset. if ! bash "$CHECKOUT/scripts/setup_mcp.sh" >"$log" 2>&1; then cat "$log" >&2 + rm -f "$log" die "scripts/setup_mcp.sh failed: MCP venv not synced" fi + rm -f "$log" ok "mcp venv synced" }