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" ' /