From b656a8a57fd3864238d06a862ce25c6d3bfe7b6d Mon Sep 17 00:00:00 2001 From: Kroese Date: Thu, 23 Jul 2026 22:31:53 +0200 Subject: [PATCH] fix: Select first matching Windows image index (#1942) --- src/image.sh | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/image.sh b/src/image.sh index 79b534fb..ea5b5d31 100644 --- a/src/image.sh +++ b/src/image.sh @@ -235,16 +235,12 @@ getImageIndex() { local wanted="$2" local platform tag index name id - local -a matches=() - [ -z "$wanted" ] && return 1 platform=$(getPlatform "$xml") for tag in DISPLAYNAME PRODUCTNAME NAME; do - matches=() - while IFS=$'\t' read -r index name; do [ -n "$index" ] || continue [[ "$name" == *"Operating System"* ]] && continue @@ -253,7 +249,8 @@ getImageIndex() { id=$(getVersion "$name" "$platform") [[ "${id,,}" == "${wanted,,}" ]] || continue - matches+=("$index") + echo "$index" + return 0 done < <( awk -v tag="$tag" ' /