Skip to content

Commit bcf3ad5

Browse files
CybotTMclaude
andcommitted
fix(scripts): use positional args for audit tool filtering
Fixed snapshot refresh after tool installation/upgrade by removing non-existent --only flag in favor of positional arguments. Changes: - install_strategy.sh: Changed --only "$tool_name" to "$tool_name" - Makefile.d/user.mk: Changed --only $* to $* for audit-% targets This fixes "Warning: Failed to refresh snapshot for <tool>" errors that occurred after successful installations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a5b179c commit bcf3ad5

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

Makefile.d/user.mk

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,34 +20,34 @@ audit: ## Render audit from snapshot (no network, <100ms)
2020
echo " Consider running '\''make update'\'' for fresh version data." >&2; \
2121
fi; \
2222
fi; \
23-
set -o pipefail; CLI_AUDIT_RENDER=1 CLI_AUDIT_GROUP=0 CLI_AUDIT_HINTS=1 CLI_AUDIT_LINKS=1 CLI_AUDIT_EMOJI=1 $(PYTHON) cli_audit.py | \
23+
set -o pipefail; CLI_AUDIT_RENDER=1 CLI_AUDIT_GROUP=0 CLI_AUDIT_HINTS=1 CLI_AUDIT_LINKS=1 CLI_AUDIT_EMOJI=1 $(PYTHON) audit.py | \
2424
$(PYTHON) smart_column.py -s "|" -t --right 3,5 --header' || true
2525

2626
audit-offline: ## Offline audit with hints (fast local scan)
27-
@bash -c 'set -o pipefail; CLI_AUDIT_OFFLINE=1 CLI_AUDIT_RENDER=1 CLI_AUDIT_GROUP=0 CLI_AUDIT_HINTS=1 CLI_AUDIT_LINKS=1 CLI_AUDIT_EMOJI=1 $(PYTHON) cli_audit.py | \
27+
@bash -c 'set -o pipefail; CLI_AUDIT_OFFLINE=1 CLI_AUDIT_RENDER=1 CLI_AUDIT_GROUP=0 CLI_AUDIT_HINTS=1 CLI_AUDIT_LINKS=1 CLI_AUDIT_EMOJI=1 $(PYTHON) audit.py | \
2828
$(PYTHON) smart_column.py -s "|" -t --right 3,5 --header' || true
2929

3030
audit-%: scripts-perms ## Audit single tool (e.g., make audit-ripgrep)
31-
@bash -c 'set -o pipefail; CLI_AUDIT_RENDER=1 CLI_AUDIT_LINKS=1 CLI_AUDIT_EMOJI=1 $(PYTHON) cli_audit.py --only $* | \
31+
@bash -c 'set -o pipefail; CLI_AUDIT_RENDER=1 CLI_AUDIT_LINKS=1 CLI_AUDIT_EMOJI=1 $(PYTHON) audit.py $* | \
3232
$(PYTHON) smart_column.py -s "|" -t --right 3,5 --header' || true
3333

3434
audit-offline-%: scripts-perms ## Offline audit subset (e.g., make audit-offline-python-core)
35-
@bash -c 'set -o pipefail; CLI_AUDIT_OFFLINE=1 CLI_AUDIT_RENDER=1 CLI_AUDIT_GROUP=0 CLI_AUDIT_HINTS=1 CLI_AUDIT_LINKS=1 CLI_AUDIT_EMOJI=1 $(PYTHON) cli_audit.py --only $* | \
35+
@bash -c 'set -o pipefail; CLI_AUDIT_OFFLINE=1 CLI_AUDIT_RENDER=1 CLI_AUDIT_GROUP=0 CLI_AUDIT_HINTS=1 CLI_AUDIT_LINKS=1 CLI_AUDIT_EMOJI=1 $(PYTHON) audit.py $* | \
3636
$(PYTHON) smart_column.py -s "|" -t --right 3,5 --header' || true
3737

3838
SNAP_FILE?=$(shell python3 -c "import os;print(os.environ.get('CLI_AUDIT_SNAPSHOT_FILE','tools_snapshot.json'))")
3939

4040
audit-auto: ## Update snapshot if missing, then render
4141
@if [ ! -f "$(SNAP_FILE)" ]; then \
4242
echo "# snapshot missing: $(SNAP_FILE); running update..."; \
43-
CLI_AUDIT_COLLECT=1 CLI_AUDIT_DEBUG=1 CLI_AUDIT_PROGRESS=1 $(PYTHON) cli_audit.py || true; \
43+
CLI_AUDIT_COLLECT=1 CLI_AUDIT_DEBUG=1 CLI_AUDIT_PROGRESS=1 $(PYTHON) audit.py --update || true; \
4444
fi; \
45-
CLI_AUDIT_RENDER=1 CLI_AUDIT_GROUP=0 CLI_AUDIT_HINTS=1 CLI_AUDIT_LINKS=1 CLI_AUDIT_EMOJI=1 $(PYTHON) cli_audit.py | \
45+
CLI_AUDIT_RENDER=1 CLI_AUDIT_GROUP=0 CLI_AUDIT_HINTS=1 CLI_AUDIT_LINKS=1 CLI_AUDIT_EMOJI=1 $(PYTHON) audit.py | \
4646
$(PYTHON) smart_column.py -s "|" -t --right 3,5 --header || true
4747

4848
update: ## Collect fresh version data with network calls and update snapshot (~10s)
4949
@echo "→ Collecting fresh version data from upstream sources..." >&2
50-
@bash -c 'set -o pipefail; CLI_AUDIT_COLLECT=1 CLI_AUDIT_TIMINGS=1 $(PYTHON) cli_audit.py' || true
50+
@bash -c 'set -o pipefail; CLI_AUDIT_COLLECT=1 CLI_AUDIT_TIMINGS=1 $(PYTHON) audit.py --update' || true
5151
@echo "✓ Snapshot updated. Run 'make audit' or 'make upgrade' to use it." >&2
5252
@echo "" >&2
5353
@echo "→ Running system health checks..." >&2
@@ -56,7 +56,7 @@ update: ## Collect fresh version data with network calls and update snapshot (~1
5656
@$(MAKE) check-node-managers || true
5757

5858
update-debug: ## Collect with verbose debug output (shows network calls)
59-
@bash -c 'set -o pipefail; CLI_AUDIT_COLLECT=1 CLI_AUDIT_DEBUG=1 CLI_AUDIT_TIMINGS=1 $(PYTHON) cli_audit.py' || true
59+
@bash -c 'set -o pipefail; CLI_AUDIT_COLLECT=1 CLI_AUDIT_DEBUG=1 CLI_AUDIT_TIMINGS=1 $(PYTHON) audit.py --update --verbose' || true
6060

6161
upgrade: scripts-perms ## Run interactive upgrade guide (uses snapshot, no network calls)
6262
@bash scripts/guide.sh

scripts/lib/install_strategy.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ refresh_snapshot() {
7373

7474
# Path to project root (scripts/lib -> scripts -> root)
7575
local project_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
76-
local audit_script="$project_root/cli_audit.py"
76+
local audit_script="$project_root/audit.py"
7777

7878
if [ ! -f "$audit_script" ]; then
79-
echo "# Warning: cli_audit.py not found at $audit_script" >&2
79+
echo "# Warning: audit.py not found at $audit_script" >&2
8080
return 1
8181
fi
8282

@@ -86,7 +86,7 @@ refresh_snapshot() {
8686
sleep 0.5
8787

8888
# Run audit in merge mode for this specific tool
89-
CLI_AUDIT_COLLECT=1 CLI_AUDIT_MERGE=1 python3 "$audit_script" --only "$tool_name" >/dev/null 2>&1 || {
89+
CLI_AUDIT_COLLECT=1 CLI_AUDIT_MERGE=1 python3 "$audit_script" "$tool_name" >/dev/null 2>&1 || {
9090
echo "# Warning: Failed to refresh snapshot for $tool_name" >&2
9191
return 1
9292
}

0 commit comments

Comments
 (0)