fix release parsing

This commit is contained in:
CanbiZ (MickLesk)
2026-04-30 13:57:35 +02:00
parent f490247be0
commit c632b4eeaa

View File

@@ -324,8 +324,13 @@ fetch_and_deploy_gh_release() {
}
get_url() {
# Convert glob-style pattern to awk ERE:
# protect existing .* → escape literal . → convert remaining * to .* → restore .*
local _re
_re=$(printf '%s' "$pattern" |
sed 's/\.\*/__DS__/g; s/\./\\./g; s/\*/.*/g; s/__DS__/.*/g')
printf '%s' "$json" | jq -r '.assets[].browser_download_url' |
awk -v p="$pattern" 'BEGIN{IGNORECASE=1} $0 ~ p {print; exit}' |
awk -v p="$_re" 'BEGIN{IGNORECASE=1} $0 ~ p {print; exit}' |
tr -d '[:cntrl:]'
}