summaryrefslogtreecommitdiff
path: root/.githooks/pre-commit
blob: 0af6083f4d6038850ae0965ee3b2cfa40221ce2d (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh
set -eu

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