Fixed highlighting with prettybat

This commit is contained in:
Ethan P 2019-06-21 14:48:21 -07:00
parent ce0c2a57f1
commit 147c823c1d
No known key found for this signature in database
GPG Key ID: 1F8DF8091CD46FBC

View File

@ -89,9 +89,9 @@ prettify() {
batify() {
if [[ "${#BAT_ARGS[@]}" -eq 0 ]]; then
bat "$1"
bat "$@"
else
bat "${BAT_ARGS[@]}" "$1"
bat "${BAT_ARGS[@]}" "$@"
fi
}
@ -99,13 +99,13 @@ EXIT=0
for file in "${FILES[@]}"; do
file_pretty="$(prettify "$file")"
if [[ $? -eq 0 ]]; then
batify "-" <<< "$file_pretty"
batify --language="${file##*.}" - <<< "$file_pretty"
exitcode=$?
else
batify "$file"
exitcode=$?
fi
if [[ $exitcode -ne 0 ]]; then
EXIT=$exitcode
fi