mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-10-18 19:10:30 +08:00
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.
50 lines
987 B
Bash
Executable File
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 "$@"
|