expiration-check/bin/create-manpage.sh
Simon Vieille e1305e18dd
All checks were successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
add set -e option in shell scripts
2024-07-29 12:19:44 +02:00

16 lines
441 B
Bash
Executable file

#!/bin/sh
set -e
(
printf ".TH expiration-check 1 \"%s\" \"Manual of expiration-check\"\n" "$(date +'%Y-%m-%d')"
printf ".LO 1\n"
./build/expiration-check-linux-amd64 -h \
| sed -E 's/^([A-Z ]+):$/.SH \1/g' \
| sed -E 's/^ (.+) (.+)/.TP\n.B \1\n\2\n\n/g' \
| sed -E 's/^ (\w+)/\1/g' \
| sed -E 's/\\{0}-([a-z]+)/\\-\1/g' \
| sed -E 's/-\\-/\\-\\-/g' \
| sed -E 's/\s+$//g'
) | gzip -9 > ./build/expiration-check.1.gz