fzf-preview.sh: Don't include the file name in type information (#4143)

Reduce the changes of misjudging the type, e.g., when file is under an `image/`
directory.
This commit is contained in:
Hong Xu 2024-12-25 21:58:10 -08:00 committed by GitHub
parent 97030d4cb1
commit fe3a9c603e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,7 +14,7 @@ if [[ $# -ne 1 ]]; then
fi fi
file=${1/#\~\//$HOME/} file=${1/#\~\//$HOME/}
type=$(file --dereference --mime -- "$file") type=$(file --brief --dereference --mime -- "$file")
if [[ ! $type =~ image/ ]]; then if [[ ! $type =~ image/ ]]; then
if [[ $type =~ =binary ]]; then if [[ $type =~ =binary ]]; then