mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-06-04 00:10:49 +00:00
fzf-preview.sh: Check the number of arguments
This commit is contained in:
parent
9a95cd5794
commit
1cfa3ee4c7
|
@ -7,7 +7,12 @@
|
||||||
# - https://github.com/hpjansson/chafa
|
# - https://github.com/hpjansson/chafa
|
||||||
# - https://github.com/sharkdp/bat
|
# - 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")
|
type=$(file --mime-type "$file")
|
||||||
|
|
||||||
if [[ ! $type =~ image/ ]]; then
|
if [[ ! $type =~ image/ ]]; then
|
||||||
|
|
Loading…
Reference in New Issue
Block a user