2017-02-13 14:01:54 -05:00
|
|
|
#!/usr/bin/env bash
|
2015-06-08 13:48:20 -04:00
|
|
|
set -e
|
|
|
|
|
|
|
|
# get into this script's directory
|
|
|
|
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
|
|
|
|
|
|
|
|
[ "$1" = '-q' ] || {
|
|
|
|
set -x
|
|
|
|
pwd
|
|
|
|
}
|
|
|
|
|
|
|
|
for FILE in *.md; do
|
|
|
|
base="$(basename "$FILE")"
|
|
|
|
name="${base%.md}"
|
|
|
|
num="${name##*.}"
|
|
|
|
if [ -z "$num" -o "$name" = "$num" ]; then
|
|
|
|
# skip files that aren't of the format xxxx.N.md (like README.md)
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
mkdir -p "./man${num}"
|
2020-05-03 16:38:09 -04:00
|
|
|
md2man -in "$FILE" -out "./man${num}/${name}"
|
2015-06-08 13:48:20 -04:00
|
|
|
done
|