mirror of
https://github.com/wader/fq.git
synced 2024-11-05 02:34:02 +03:00
16 lines
379 B
Bash
16 lines
379 B
Bash
|
#!/bin/sh
|
||
|
set -eu
|
||
|
|
||
|
REPODIR=$(pwd)
|
||
|
TEMPDIR=$(mktemp -d)
|
||
|
cp -a doc/* "${TEMPDIR}"
|
||
|
go build -o "${TEMPDIR}/fq" main.go
|
||
|
for f in "$@"; do
|
||
|
cd "${TEMPDIR}"
|
||
|
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}"
|