summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry J. Webster <hwebs@hwebs.info>2026-10-31 13:35:31 -0500
committerHenry J. Webster <hwebs@hwebs.info>2026-10-31 13:35:31 -0500
commit0f200b416bfd5b0925c06527b3f8bdf5040caf6e (patch)
tree35240646d96c3cec7eec90cbd94e1ebd5c59fb2c
parentfc667669efbffdaa93e10a4ccef9142f1aff96ab (diff)
fix pre-commit
-rwxr-xr-x.githooks/pre-commit10
1 files changed, 8 insertions, 2 deletions
diff --git a/.githooks/pre-commit b/.githooks/pre-commit
index 5ba733d..0af6083 100755
--- a/.githooks/pre-commit
+++ b/.githooks/pre-commit
@@ -1,5 +1,11 @@
#!/bin/sh
set -eu
-git ls-files -z --cached -- '*.caddy' 'Caddyfile' '*/Caddyfile' |
- xargs -0 -r caddy fmt --overwrite \ No newline at end of file
+for file in Caddyfile site/cgit/Caddyfile; do
+ caddy fmt --overwrite "$file"
+done
+
+if ! git diff --quiet -- Caddyfile site/cgit/Caddyfile; then
+ echo "Caddyfiles were formatted. Review and stage the changes."
+ exit 1
+fi \ No newline at end of file