Image shuffle: path no longer requires a '/' - @aranega

This commit is contained in:
Dylan Araps 2016-06-10 23:10:54 +10:00
parent b854e4a148
commit 470afe9509

View file

@ -2265,7 +2265,7 @@ getimage () {
"ascii") getascii; return ;; "ascii") getascii; return ;;
*) *)
if [ -d "$image" ]; then if [ -d "$image" ]; then
files=("$image"*.{png,jpg,jpeg}) files=("${image%/}"/*.{png,jpg,jpeg})
img="$(printf "%s" "${files[RANDOM % (${#files[@]} - 1)]}")" img="$(printf "%s" "${files[RANDOM % (${#files[@]} - 1)]}")"
else else
img="$image" img="$image"