2021-09-18 19:24:12 +03:00
|
|
|
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
|
2021-09-19 11:51:18 +03:00
|
|
|
FQ="$1"
|
|
|
|
shift
|
|
|
|
|
2021-09-18 19:24:12 +03:00
|
|
|
REPODIR=$(pwd)
|
2022-01-29 14:01:36 +03:00
|
|
|
export REPODIR
|
2021-09-18 19:24:12 +03:00
|
|
|
TEMPDIR=$(mktemp -d)
|
|
|
|
cp -a doc/* "${TEMPDIR}"
|
2021-09-19 11:51:18 +03:00
|
|
|
cp "$FQ" "${TEMPDIR}/fq"
|
|
|
|
cd "${TEMPDIR}"
|
2021-09-18 19:24:12 +03:00
|
|
|
for f in "$@"; do
|
|
|
|
echo "Generate $f"
|
|
|
|
mkdir -p "$(dirname "${TEMPDIR}/$f")"
|
|
|
|
PATH="${TEMPDIR}:${PATH}" go run "${REPODIR}/doc/mdsh.go" >"${TEMPDIR}/$f" <"${REPODIR}/$f"
|
|
|
|
mv "${TEMPDIR}/$f" "${REPODIR}/$f"
|
|
|
|
done
|
|
|
|
rm -rf "${TEMPDIR}"
|