2014-04-16 18:07:55 +00:00
|
|
|
#!/bin/bash
|
2014-04-16 20:15:57 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
# get into this script's directory
|
|
|
|
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
|
|
|
|
|
|
|
|
[ "$1" = '-q' ] || {
|
|
|
|
set -x
|
|
|
|
pwd
|
|
|
|
}
|
|
|
|
|
2014-04-22 12:43:08 +00:00
|
|
|
for FILE in *.md; do
|
|
|
|
base="$(basename "$FILE")"
|
|
|
|
name="${base%.md}"
|
|
|
|
num="${name##*.}"
|
2014-06-14 07:44:55 +00:00
|
|
|
if [ -z "$num" -o "$name" = "$num" ]; then
|
2014-04-22 12:43:08 +00:00
|
|
|
# skip files that aren't of the format xxxx.N.md (like README.md)
|
|
|
|
continue
|
|
|
|
fi
|
2014-06-25 16:04:59 +00:00
|
|
|
mkdir -p "./man${num}"
|
2014-08-05 00:59:37 +00:00
|
|
|
go-md2man -in "$FILE" -out "./man${num}/${name}"
|
2014-04-16 20:15:57 +00:00
|
|
|
done
|