aboutsummaryrefslogtreecommitdiff
path: root/aux/workflow/assert-manpages.sh
blob: 712a2bb4ef488c3147e3e79adf432a81b803d9a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
set -eu

PROJECT="$1"
MAILING_LIST="$2"
TLD="$(cat aux/tld.txt)"

EXPECTED="$(mktemp)"
cat <<EOF >> "$EXPECTED"
.
.
.SH AUTHORS
.P
EuAndreh
.MT eu@euandre.org
.ME
and contributors.
.
.
.SH BUGS
Report bugs to:
.MT ~euandreh/$MAILING_LIST@lists.sr.ht
.ME
.br
Browse bugs at:
.UR https://$TLD/$PROJECT/TODOs.html
.UE
.br
Home page:
.UR https://$TLD/$PROJECT/
.UE
.br
Discussions:
.UR https://lists.sr.ht/~euandreh/$MAILING_LIST?search=[$PROJECT]
.UE
EOF

# shellcheck disable=2044
for f in $(find doc -type f -name '*.[0-9]'); do
	if ! tail -n "$(wc -l < "$EXPECTED")" "$f" | diff - "$EXPECTED"; then
		echo "Missing metadata at the end of \"$f\" file"
		exit 1
	fi
done