From b557c56d44839deb84c0c4ba86748b4dbb40171b Mon Sep 17 00:00:00 2001 From: somini Date: Tue, 10 Nov 2020 23:39:47 +0000 Subject: Tweak imv-folder file sorting Make sure to version-sort the files. Requires a non-POSIX `sort`, which should be a mild requirement. See https://github.com/eXeC64/imv/commit/d12470375a33230ffaaea407237125f18f812781#commitcomment-44048679 --- files/imv-folder | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'files/imv-folder') diff --git a/files/imv-folder b/files/imv-folder index 151fc51..33ea051 100755 --- a/files/imv-folder +++ b/files/imv-folder @@ -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 -- cgit v1.2.3