mirror of
https://github.com/eth-p/bat-extras.git
synced 2025-06-20 19:57:46 +02:00
Fixed highlighting with prettybat
This commit is contained in:
parent
ce0c2a57f1
commit
147c823c1d
@ -89,9 +89,9 @@ prettify() {
|
|||||||
|
|
||||||
batify() {
|
batify() {
|
||||||
if [[ "${#BAT_ARGS[@]}" -eq 0 ]]; then
|
if [[ "${#BAT_ARGS[@]}" -eq 0 ]]; then
|
||||||
bat "$1"
|
bat "$@"
|
||||||
else
|
else
|
||||||
bat "${BAT_ARGS[@]}" "$1"
|
bat "${BAT_ARGS[@]}" "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,13 +99,13 @@ EXIT=0
|
|||||||
for file in "${FILES[@]}"; do
|
for file in "${FILES[@]}"; do
|
||||||
file_pretty="$(prettify "$file")"
|
file_pretty="$(prettify "$file")"
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
batify "-" <<< "$file_pretty"
|
batify --language="${file##*.}" - <<< "$file_pretty"
|
||||||
exitcode=$?
|
exitcode=$?
|
||||||
else
|
else
|
||||||
batify "$file"
|
batify "$file"
|
||||||
exitcode=$?
|
exitcode=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $exitcode -ne 0 ]]; then
|
if [[ $exitcode -ne 0 ]]; then
|
||||||
EXIT=$exitcode
|
EXIT=$exitcode
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user