fzf-preview.sh: Check the number of arguments

pull/3504/head
Junegunn Choi 7 months ago
parent 9a95cd5794
commit 1cfa3ee4c7
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

@ -7,7 +7,12 @@
# - https://github.com/hpjansson/chafa
# - https://github.com/sharkdp/bat
file=$1
if [[ $# -ne 1 ]]; then
>&2 echo "usage: $0 FILENAME"
exit 1
fi
file=${1/#\~\//$HOME/}
type=$(file --mime-type "$file")
if [[ ! $type =~ image/ ]]; then

Loading…
Cancel
Save