From 147c823c1d520dda24fffbceda44ea555df81dc1 Mon Sep 17 00:00:00 2001 From: Ethan P Date: Fri, 21 Jun 2019 14:48:21 -0700 Subject: [PATCH] Fixed highlighting with prettybat --- src/prettybat.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/prettybat.sh b/src/prettybat.sh index 8f52477..0fd2792 100755 --- a/src/prettybat.sh +++ b/src/prettybat.sh @@ -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