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