mirror of
https://github.com/wader/fq.git
synced 2024-11-24 03:05:22 +03:00
9cb4b57a45
Should supress cancel error message Add CLI ctlr-c/ctrl-d tests and make them more robust
22 lines
421 B
Bash
Executable File
22 lines
421 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
FQ="$1"
|
|
shift
|
|
|
|
if which expect >/dev/null 2>&1; then
|
|
TEMPDIR=$(mktemp -d)
|
|
cp "$FQ" "${TEMPDIR}/fq"
|
|
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
|
|
echo "$0"
|
|
else
|
|
echo "$0: skip as expect is not installed"
|
|
fi
|