mirror of
https://github.com/eth-p/bat-extras.git
synced 2024-12-13 17:50:56 +01:00
16 lines
374 B
Bash
Executable File
16 lines
374 B
Bash
Executable File
#!/usr/bin/env bash
|
|
exec 3<&0
|
|
|
|
# Find the real bat.
|
|
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
while read -d ':' -r dir; do
|
|
if [[ "$dir" == "$HERE" || -z "$dir" ]]; then continue; fi
|
|
if [[ -f "${dir}/bat" ]]; then
|
|
exec "${dir}/bat" "$@" --no-config --theme="Monokai Extended" <&3
|
|
fi
|
|
done <<<"$PATH:"
|
|
|
|
# Print error and exit.
|
|
echo "bat was not found on \$PATH" 1>&2
|
|
exit 127
|