chore: Fix indentation

This commit is contained in:
Donovan Glover 2023-12-20 19:21:40 -05:00
parent bd67cf43a9
commit 10f1388912
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -481,64 +481,65 @@
realpath=$(realpath "$FILE_PATH")
handle_extension() {
case "''${FILE_EXTENSION_LOWER}" in
ts | js | lock)
bat --color=always --paging=never \
--style=plain \
--terminal-width="''${PREVIEW_WIDTH}" \
"''${FILE_PATH}" && exit 0
cat "''${FILE_PATH}" && exit 0
exit 1;;
case "''${FILE_EXTENSION_LOWER}" in
ts | js | lock)
bat --color=always --paging=never \
--style=plain \
--terminal-width="''${PREVIEW_WIDTH}" \
"''${FILE_PATH}" && exit 0
cat "''${FILE_PATH}" && exit 0
exit 1;;
rar)
lsar "''${FILE_PATH}" && exit 0
exit 1;;
7z)
7z l -p -- "''${FILE_PATH}" && exit 0
exit 1;;
rar)
lsar "''${FILE_PATH}" && exit 0
exit 1;;
pdf)
pdftotext -l 10 -nopgbrk -q -- "''${FILE_PATH}" - | \
fmt -w "''${PREVIEW_WIDTH}" && exit 0
mutool draw -F txt -i -- "''${FILE_PATH}" 1-10 | \
fmt -w "''${PREVIEW_WIDTH}" && exit 0
exiftool "''${FILE_PATH}" && exit 0
exit 1;;
7z)
7z l -p -- "''${FILE_PATH}" && exit 0
exit 1;;
torrent)
transmission-show -- "''${FILE_PATH}" && exit 0
exit 1;;
pdf)
pdftotext -l 10 -nopgbrk -q -- "''${FILE_PATH}" - | \
fmt -w "''${PREVIEW_WIDTH}" && exit 0
mutool draw -F txt -i -- "''${FILE_PATH}" 1-10 | \
fmt -w "''${PREVIEW_WIDTH}" && exit 0
exiftool "''${FILE_PATH}" && exit 0
exit 1;;
json)
jq --color-output . "''${FILE_PATH}" && exit 0
;;
esac
torrent)
transmission-show -- "''${FILE_PATH}" && exit 0
exit 1;;
json)
jq --color-output . "''${FILE_PATH}" && exit 0
;;
esac
}
handle_mime() {
local mimetype="''${1}"
case "''${mimetype}" in
## Text
text/* | */xml)
bat --color=always --paging=never \
--style=plain \
--terminal-width="''${PREVIEW_WIDTH}" \
"''${FILE_PATH}" && exit 0
cat "''${FILE_PATH}" && exit 0
exit 1;;
## Text
text/* | */xml)
bat --color=always --paging=never \
--style=plain \
--terminal-width="''${PREVIEW_WIDTH}" \
"''${FILE_PATH}" && exit 0
cat "''${FILE_PATH}" && exit 0
exit 1;;
## Image
image/*)
exit 5;;
## Image
image/*)
exit 5;;
## Video and audio
video/* | audio/*)
echo "$realpath"
mediainfo "''${FILE_PATH}" && exit 0
exiftool "''${FILE_PATH}" && exit 0
exit 1;;
esac
## Video and audio
video/* | audio/*)
echo "$realpath"
mediainfo "''${FILE_PATH}" && exit 0
exiftool "''${FILE_PATH}" && exit 0
exit 1;;
esac
}
FILE_EXTENSION="''${FILE_PATH##*.}"