test: Fix bat shimexec

This commit is contained in:
Ethan P 2020-05-06 18:56:27 -07:00
parent 875504ba06
commit f9b18f7e8e
No known key found for this signature in database
GPG Key ID: 6963FD04F6CF35EA

View File

@ -2,8 +2,12 @@
# Find the real bat.
HERE="$(cd "$(dirname "$0")" && pwd)"
while read -d ':' -r dir; do
if [[ "$dir" == "$HERE" ]]; then continue; fi
if [[ "$dir" == "$HERE" || -z "$dir" ]]; then continue; fi
if [[ -f "${dir}/bat" ]]; then
exec "${dir}/bat" "$@" --theme="Monokai Extended"
fi
done <<<"$PATH"
done <<<"$PATH:"
# Print error and exit.
echo "bat was not found on \$PATH" 1>&2
exit 127