summaryrefslogtreecommitdiffstats
path: root/.claude/hooks/bash-format.sh
blob: b260faec1339141cc8f31dc399f192ca0e8da634 (plain)
1
2
3
4
5
#!/bin/bash
file_path=$(jq -r '.tool_input.file_path')
if [[ "$file_path" =~ \.(sh|bash)$ ]] || head -1 "$file_path" 2>/dev/null | grep -q '^#!/.*bash\|^#!/.*sh'; then
	shfmt -w "$file_path"
fi