Tweak imv-folder file sorting

Make sure to version-sort the files. Requires a non-POSIX `sort`, which
should be a mild requirement.

See
d12470375a (commitcomment-44048679)
This commit is contained in:
somini 2020-11-10 23:39:47 +00:00 committed by Harry Jeffery
parent c415c456ea
commit b557c56d44

View file

@ -1,7 +1,8 @@
#!/bin/bash
image="$1"
declare -a ARGS
for a in "$(dirname "$image")"/*; do
declare -a ARGS order
readarray -t -d '' order < <(printf '%s\0' "$(dirname "$image")"/* | sort -z --sort=version)
for a in "${order[@]}"; do
if [ -f "$a" ]; then
ARGS+=("$a")
fi