File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- # Post-edit hook to format files after creating/editing
3+ # Post-write hook to format files after creating
44# This is the bash equivalent of lint-staged in package.json
55
66# To test this file directly via cli:
7- # echo '{"tool_input": {"file_path": "path/to/your/file"}}' | .claude/hooks/post-edit .sh
7+ # echo '{"tool_input": {"file_path": "path/to/your/file"}}' | .claude/hooks/post-write-format .sh
88
99# Read JSON from stdin and extract file path
1010FILE=$( jq -r ' .tool_input.file_path' 2> /dev/null)
Original file line number Diff line number Diff line change 22 "hooks" : {
33 "PostToolUse" : [
44 {
5- "matcher" : " Edit| Write" ,
5+ "matcher" : " Write" ,
66 "hooks" : [
77 {
88 "type" : " command" ,
9- "command" : " .claude/hooks/post-edit .sh"
9+ "command" : " .claude/hooks/post-write-format .sh"
1010 }
1111 ]
1212 }
You can’t perform that action at this time.
0 commit comments