1
1
mirror of https://github.com/wader/fq.git synced 2024-11-24 03:05:22 +03:00
fq/pkg/cli/test.sh
2021-09-18 18:23:28 +02:00

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