mirror of
https://github.com/docker/docs.git
synced 2026-06-19 07:35:16 +00:00
2c4facb6d0
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
13 lines
342 B
Bash
Executable File
13 lines
342 B
Bash
Executable File
#!/bin/bash
|
|
# PostToolUse hook for Edit/Write in the write skill.
|
|
# Auto-formats Markdown files with prettier after each edit.
|
|
set -euo pipefail
|
|
|
|
input=$(cat)
|
|
file_path=$(echo "$input" | jq -r '.tool_input.file_path // empty')
|
|
|
|
[ -z "$file_path" ] && exit 0
|
|
[[ "$file_path" != *.md ]] && exit 0
|
|
|
|
npx prettier --write "$file_path" 2>/dev/null
|