diff options
author | somini <dev@somini.xyz> | 2020-11-10 23:39:47 +0000 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2021-07-08 23:30:24 +0100 |
commit | b557c56d44839deb84c0c4ba86748b4dbb40171b (patch) | |
tree | 8e7599210f53f86f4e47279a55a6c597d8b9fdd6 | |
parent | c415c456eac994ee89605e9a8098a163e452e70f (diff) | |
download | imv-b557c56d44839deb84c0c4ba86748b4dbb40171b.tar.gz |
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
-rwxr-xr-x | files/imv-folder | 5 |
1 files changed, 3 insertions, 2 deletions
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 |