mirror of
https://github.com/opencontainers/runc.git
synced 2025-09-27 03:46:19 +08:00

Now the only remaining file that needs shellcheck warnings to be fixed is bash-completion. Note that in Makefile's TODO. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
28 lines
540 B
Bash
Executable File
28 lines
540 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# get into this script's directory
|
|
cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
|
|
|
|
[ "$1" = '-q' ] || {
|
|
set -x
|
|
pwd
|
|
}
|
|
|
|
if ! type go-md2man; then
|
|
echo "To install man pages, please install 'go-md2man'."
|
|
exit 0
|
|
fi
|
|
|
|
for FILE in *.md; do
|
|
base="$(basename "$FILE")"
|
|
name="${base%.md}"
|
|
num="${name##*.}"
|
|
if [ -z "$num" ] || [ "$name" = "$num" ]; then
|
|
# skip files that aren't of the format xxxx.N.md (like README.md)
|
|
continue
|
|
fi
|
|
mkdir -p "./man${num}"
|
|
go-md2man -in "$FILE" -out "./man${num}/${name}"
|
|
done
|