go_wireproto/.githooks/pre-commit/01-docgen
brent saner d4bb259b83
v1.0.0
Initial release.
2024-07-10 00:18:54 -04:00

20 lines
353 B
Bash
Executable File

#!/bin/bash
docsdir="${PWD}"
if ! command -v asciidoctor &> /dev/null;
then
exit 0
fi
mkdir -p "${docsdir}"
for f in $(find . -maxdepth 1 -type f -iname "*.adoc"); do
filename=$(basename -- "${f}")
nosuffix="${filename%.*}"
asciidoctor -o "${docsdir}/${nosuffix}.html" "${f}"
git add "${docsdir}/${nosuffix}.html"
done
echo "Regenerated docs"