Skip to content

Commit a5b179c

Browse files
CybotTMclaude
andcommitted
fix(guide): reload full audit JSON to prevent cascading failures
Fixed issue where failed upgrade attempts caused all subsequent tools to show <none> for installed version and unknown install method. Root cause: Single-tool audit overwrote AUDIT_JSON with only that tool's data, breaking subsequent jq lookups. Solution: Update snapshot silently, then reload full audit JSON: 1. CLI_AUDIT_COLLECT=1 CLI_AUDIT_MERGE=1 audit.py "$tool" >/dev/null 2. CLI_AUDIT_JSON=1 CLI_AUDIT_RENDER=1 audit.py (reload all tools) This preserves full tool list throughout upgrade session. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ac8a95a commit a5b179c

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

scripts/guide.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ check_cache_age() {
3737
check_cache_age || true
3838

3939
echo "Gathering current tool status from snapshot..."
40-
AUDIT_OUTPUT="$(cd "$ROOT" && CLI_AUDIT_RENDER=1 CLI_AUDIT_LINKS=0 CLI_AUDIT_EMOJI=0 "$CLI" cli_audit.py || true)"
41-
AUDIT_JSON="$(cd "$ROOT" && CLI_AUDIT_JSON=1 CLI_AUDIT_RENDER=1 "$CLI" cli_audit.py || true)"
40+
AUDIT_OUTPUT="$(cd "$ROOT" && CLI_AUDIT_RENDER=1 CLI_AUDIT_LINKS=0 CLI_AUDIT_EMOJI=0 "$CLI" audit.py || true)"
41+
AUDIT_JSON="$(cd "$ROOT" && CLI_AUDIT_JSON=1 CLI_AUDIT_RENDER=1 "$CLI" audit.py || true)"
4242

4343
if [ "$VERBOSE" = "1" ]; then
4444
printf "%s\n" "$AUDIT_OUTPUT" | "$CLI" smart_column.py -s '|' -t --right 3,5 --header || printf "%s\n" "$AUDIT_OUTPUT"
@@ -158,8 +158,11 @@ process_tool() {
158158
"$ROOT"/scripts/$install_cmd && upgrade_success=1 || true
159159
fi
160160

161-
# Re-audit
162-
AUDIT_JSON="$(cd "$ROOT" && CLI_AUDIT_JSON=1 CLI_AUDIT_RENDER=1 "$CLI" cli_audit.py || true)"
161+
# Re-audit with fresh collection for this specific tool (updates snapshot silently)
162+
CLI_AUDIT_JSON=1 CLI_AUDIT_COLLECT=1 CLI_AUDIT_MERGE=1 "$CLI" audit.py "$tool" >/dev/null 2>&1 || true
163+
164+
# Reload full audit JSON from updated snapshot (needed for subsequent tools)
165+
AUDIT_JSON="$(cd "$ROOT" && CLI_AUDIT_JSON=1 CLI_AUDIT_RENDER=1 "$CLI" audit.py || true)"
163166

164167
# Check if upgrade succeeded by comparing versions
165168
local new_installed="$(json_field "$tool" installed)"

0 commit comments

Comments
 (0)