Skip to content

Commit

Permalink
fzf-preview.sh: Don't include the file name in type information (#4143)
Browse files Browse the repository at this point in the history
Reduce the changes of misjudging the type, e.g., when file is under an `image/`
directory.
  • Loading branch information
xuhdev authored Dec 26, 2024
1 parent 97030d4 commit fe3a9c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/fzf-preview.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fe3a9c6

Please sign in to comment.