Files
heartwood/scripts/build-man-pages.sh
T
Fintan Halpenny 9ff0e8b01f just: checking for ellipses
Add custom check for ellipses "...", asking for replacement of "…".

Git ranges and the CLI wildcard matches are ignored.

This change includes fixes to all sites that did not pass the check.
2026-05-28 16:52:02 +01:00

50 lines
987 B
Bash
Executable File

#!/bin/sh
set -e
# Attempt to install `asciidoctor` on Debian, Arch Linux and macOS.
install() {
os="$(uname)"
case "$os" in
Linux)
if command -v apt-get >/dev/null 2>&1; then
# Debian
apt-get update
apt-get install -y asciidoctor
elif command -v pacman >/dev/null 2>&1; then
# Arch Linux
pacman -Sy --noconfirm asciidoctor
fi ;;
Darwin) # macOS
if command -v brew >/dev/null 2>&1; then
brew install asciidoctor
fi ;;
*)
echo "fatal: unknown operating system: $os"
exit 1 ;;
esac
}
main() {
if [ $# -lt 2 ]; then
echo "usage: $0 <output-dir> <input-file>…"
exit 1
fi
outdir="$1"
shift
if ! command -v asciidoctor >/dev/null 2>&1; then
echo "Installing 'asciidoctor'.."
install
fi
for input in "$@"; do
echo "Building $input.."
asciidoctor --doctype manpage --backend manpage --destination-dir "$outdir" "$input"
done
}
main "$@"