mirror of
https://github.com/wader/fq.git
synced 2024-11-24 03:05:22 +03:00
18 lines
399 B
Bash
Executable File
18 lines
399 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
if which expect >/dev/null 2>&1; then
|
|
TEMPDIR=$(mktemp -d)
|
|
go build -o "${TEMPDIR}/fq" main.go
|
|
PATH="${TEMPDIR}:${PATH}" expect "$1" >"${TEMPDIR}/fq.log" && FAIL=0 || FAIL=1
|
|
if [ $FAIL = "1" ]; then
|
|
cat "${TEMPDIR}/fq.log"
|
|
fi
|
|
rm -rf "${TEMPDIR}"
|
|
if [ $FAIL = "1" ]; then
|
|
exit 1
|
|
fi
|
|
else
|
|
echo "skip as expect is not installed"
|
|
fi
|