18 lines
510 B
JSON
18 lines
510 B
JSON
{
|
|
"description": "Ensure POSIX compliance by adding final newlines to files",
|
|
"hooks": {
|
|
"PostToolUse": [
|
|
{
|
|
"matcher": "Write|Edit|MultiEdit",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "file_path=$(grep -o '\"file_path\":\"[^\"]*\"' | sed 's/\"file_path\":\"\\(.*\\)\"/\\1/'); if [ -f \"$file_path\" ] && [ -n \"$(tail -c1 \"$file_path\")\" ]; then echo >> \"$file_path\"; fi",
|
|
"timeout": 5
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|