Debian Codegraph @

docs/pre-commit

raw
1 #!/bin/sh
2
3 set -e
4
5 pushd docs >/dev/null
6
7 if git diff --name-only --staged -- *.adoc | grep -q ^
8 then
9 rake -v
10 echo "Documentation was regenerated."
11
12 if git diff --name-only -- *.adoc | grep -q ^
13 then
14 echo "Some documentation source files are unstaged,"
15 echo "stage and commit hunks yourself with:"
16 echo
17 echo " git commit --no-verify --patch *.1 *.html"
18 echo
19
20 exit 1
21 fi
22
23 git add -v -u *.1 *.html
24 fi
25
26 popd >/dev/null