fix(scripts): replace hardcoded developer paths in test-v1-vs-v2.sh

REPO_DIR now derives from the script's location (with env-var override)
and the Claude binary is looked up via PATH (with CLAUDE env-var override)
instead of hardcoded to /Users/mvanhorn/.local/bin/claude. Works on any
checkout. Closes #297.

Co-authored-by: Dave Morin <dave@morin.com>
This commit is contained in:
Trevin Chow
2026-05-17 01:27:33 -07:00
parent 76b8df40d3
commit bb5e6efbf9
+3 -2
View File
@@ -6,7 +6,8 @@ set -euo pipefail
# using `claude --print` to capture real end-to-end output. # using `claude --print` to capture real end-to-end output.
SKILL_DIR="$HOME/.claude/skills/last30days" SKILL_DIR="$HOME/.claude/skills/last30days"
REPO_DIR="/Users/mvanhorn/last30days-skill" REPO_DIR="${REPO_DIR:-$(cd "$(dirname "$0")/.." && pwd)}"
CLAUDE="${CLAUDE:-$(command -v claude || echo claude)}"
# Safety: always restore V2 SKILL.md on exit/crash # Safety: always restore V2 SKILL.md on exit/crash
cleanup() { cleanup() {
@@ -101,7 +102,7 @@ run_version() {
# Run claude --print with the skill invocation # Run claude --print with the skill invocation
# No timeout — claude --print exits on its own; kill manually if stuck # No timeout — claude --print exits on its own; kill manually if stuck
if /Users/mvanhorn/.local/bin/claude --print \ if "$CLAUDE" --print \
"/last30days $query" \ "/last30days $query" \
> "$outfile" 2>"$errfile"; then > "$outfile" 2>"$errfile"; then
local end_time local end_time