1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-07-25 01:01:58 -07:00

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

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

@@ -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