fzf-preview.sh: Don't include the file name in type information (#4143)
Some checks failed
CodeQL / Analyze (go) (push) Has been cancelled
Test fzf on Linux / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Generate Sponsors README / deploy (push) Has been cancelled

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

View File

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