developer: Fix bat reading data from stdin during tests

This commit is contained in:
Ethan P 2020-10-28 19:32:24 -07:00
parent a6a1e55522
commit 4761b594a6
No known key found for this signature in database
GPG Key ID: 6963FD04F6CF35EA

View File

@ -1,10 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
exec 3<&0
# Find the real bat. # Find the real bat.
HERE="$(cd "$(dirname "$0")" && pwd)" HERE="$(cd "$(dirname "$0")" && pwd)"
while read -d ':' -r dir; do while read -d ':' -r dir; do
if [[ "$dir" == "$HERE" || -z "$dir" ]]; then continue; fi if [[ "$dir" == "$HERE" || -z "$dir" ]]; then continue; fi
if [[ -f "${dir}/bat" ]]; then if [[ -f "${dir}/bat" ]]; then
exec "${dir}/bat" "$@" --no-config --theme="Monokai Extended" exec "${dir}/bat" "$@" --no-config --theme="Monokai Extended" <&3
fi fi
done <<<"$PATH:" done <<<"$PATH:"