bat-extras/test/shimexec/bat

14 lines
359 B
Plaintext
Raw Normal View History

#!/usr/bin/env bash
# Find the real bat.
HERE="$(cd "$(dirname "$0")" && pwd)"
while read -d ':' -r dir; do
2020-05-07 03:56:27 +02:00
if [[ "$dir" == "$HERE" || -z "$dir" ]]; then continue; fi
if [[ -f "${dir}/bat" ]]; then
2020-05-07 03:57:04 +02:00
exec "${dir}/bat" "$@" --no-config --theme="Monokai Extended"
fi
2020-05-07 03:56:27 +02:00
done <<<"$PATH:"
# Print error and exit.
echo "bat was not found on \$PATH" 1>&2
exit 127