mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-03-20 23:06:51 +00:00
Replace inline command strings in settings.json with external scripts in .claude/hooks/ for readability and maintainability. Consolidate three PostToolUse formatters into one script and add markdown/yaml formatting. Add new hooks: SessionStart context banner, Stop lint gate, async Bats test runner, idle desktop notification, and PostToolUseFailure logger.
17 lines
318 B
Bash
Executable File
17 lines
318 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Stop gate: run yarn lint before Claude finishes.
|
|
# Exit 2 sends feedback back and keeps Claude working.
|
|
|
|
cd "$CLAUDE_PROJECT_DIR" || exit 0
|
|
|
|
output=$(yarn lint 2>&1)
|
|
status=$?
|
|
|
|
if [ $status -ne 0 ]; then
|
|
echo "Lint failed — fix before finishing:" >&2
|
|
echo "$output" >&2
|
|
exit 2
|
|
fi
|
|
|
|
exit 0
|