diff --git a/.claude/scripts/pre-merge-check.ts b/.claude/scripts/pre-merge-check.ts index 9c093153..67fe4329 100644 --- a/.claude/scripts/pre-merge-check.ts +++ b/.claude/scripts/pre-merge-check.ts @@ -29,7 +29,7 @@ function fail(msg: string): never { // Find repo root — try extracting a worktree path from the command, else use git let repoRoot: string; -const worktreeMatch = command.match(/\/tmp\/spawn-worktrees\/[^\s/]+/); +const worktreeMatch = command.match(/\/tmp\/spawn-worktrees\/[^\s]+/); if (worktreeMatch) { repoRoot = worktreeMatch[0]; } else { diff --git a/.claude/settings.json b/.claude/settings.json index 35c7bf48..b51a8655 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -30,7 +30,7 @@ "hooks": [ { "type": "command", - "command": "bash -c 'INPUT=$(cat); CMD=$(echo \"$INPUT\" | jq -r \".tool_input.command // empty\"); echo \"$CMD\" | grep -qE \"gh pr (merge|ready)\" || exit 0; WT=$(echo \"$CMD\" | grep -oE \"/tmp/spawn-worktrees/[a-zA-Z0-9._-]+\" | head -1); if [ -n \"$WT\" ] && [ -d \"$WT/packages/cli\" ]; then ROOT=\"$WT\"; else ROOT=$(git rev-parse --show-toplevel 2>/dev/null); fi; if [ -z \"$ROOT\" ] || [ ! -d \"$ROOT/packages/cli\" ]; then echo \"WARNING: Could not find spawn repo for pre-merge checks\" >&2; exit 0; fi; cd \"$ROOT/packages/cli\" || exit 2; echo \"Pre-merge gate: running biome check + bun test in $ROOT/packages/cli ...\" >&2; bunx @biomejs/biome check src/ 2>&1 || { echo \"BLOCKED: biome check failed — fix lint/format issues before merging\" >&2; exit 2; }; bun test 2>&1 || { echo \"BLOCKED: tests failed — fix failures before merging\" >&2; exit 2; }; echo \"Pre-merge checks passed\" >&2'" + "command": "bash -c 'INPUT=$(cat); CMD=$(echo \"$INPUT\" | jq -r \".tool_input.command // empty\"); echo \"$CMD\" | grep -qE \"gh pr (merge|ready)\" || exit 0; WT=$(echo \"$CMD\" | grep -oE \"/tmp/spawn-worktrees/[a-zA-Z0-9._/-]+\" | head -1); if [ -n \"$WT\" ] && [ -d \"$WT/packages/cli\" ]; then ROOT=\"$WT\"; else ROOT=$(git rev-parse --show-toplevel 2>/dev/null); fi; if [ -z \"$ROOT\" ] || [ ! -d \"$ROOT/packages/cli\" ]; then echo \"WARNING: Could not find spawn repo for pre-merge checks\" >&2; exit 0; fi; cd \"$ROOT/packages/cli\" || exit 2; echo \"Pre-merge gate: running biome check + bun test in $ROOT/packages/cli ...\" >&2; bunx @biomejs/biome check src/ 2>&1 || { echo \"BLOCKED: biome check failed — fix lint/format issues before merging\" >&2; exit 2; }; bun test 2>&1 || { echo \"BLOCKED: tests failed — fix failures before merging\" >&2; exit 2; }; echo \"Pre-merge checks passed\" >&2'" } ] }