Fix url assignment in fetch_and_deploy_gh_release
This commit is contained in:
parent
000a7a2701
commit
d7d16543e5
@ -317,9 +317,15 @@ fetch_and_deploy_gh_release() {
|
|||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# The command is the same for all cases other than tarball/source
|
||||||
|
get_url() { # $1 pattern
|
||||||
|
printf '%s' "$json" | jq -r '.assets[].browser_download_url' |
|
||||||
|
awk -v p="$1" 'BEGIN{IGNORECASE=1} $0 ~ p {print; exit}'
|
||||||
|
}
|
||||||
|
|
||||||
case "$mode" in
|
case "$mode" in
|
||||||
tarball | source)
|
tarball | source)
|
||||||
url="$(printf '%s' "$json" | jq -r '.tarball_url // empty')"
|
url=$(printf '%s' "$json" | jq -r '.tarball_url // empty')
|
||||||
[ -z "$url" ] && url="https://github.com/$repo/archive/refs/tags/v$version.tar.gz"
|
[ -z "$url" ] && url="https://github.com/$repo/archive/refs/tags/v$version.tar.gz"
|
||||||
filename="${app_lc}-${version}.tar.gz"
|
filename="${app_lc}-${version}.tar.gz"
|
||||||
download_with_progress "$url" "$tmpd/$filename" || {
|
download_with_progress "$url" "$tmpd/$filename" || {
|
||||||
@ -342,7 +348,7 @@ fetch_and_deploy_gh_release() {
|
|||||||
;;
|
;;
|
||||||
binary)
|
binary)
|
||||||
[ -n "$pattern" ] || pattern="*.apk"
|
[ -n "$pattern" ] || pattern="*.apk"
|
||||||
url="$(printf '%s' "$json" | jq -r '.assets[].browser_download_url' | awk -v p="$pattern" 'BEGIN{IGNORECASE=1} $0 ~ p {print; exit}')"
|
url=$(get_url "$pattern")
|
||||||
[ -z "$url" ] && {
|
[ -z "$url" ] && {
|
||||||
msg_error "binary asset not found for pattern: $pattern"
|
msg_error "binary asset not found for pattern: $pattern"
|
||||||
rm -rf "$tmpd"
|
rm -rf "$tmpd"
|
||||||
@ -374,10 +380,7 @@ fetch_and_deploy_gh_release() {
|
|||||||
rm -rf "$tmpd"
|
rm -rf "$tmpd"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
url="$(printf '%s' "$json" | jq -r '.assets[].browser_download_url' | awk -v p="$pattern" '
|
url=$(get_url "$pattern")
|
||||||
BEGIN{IGNORECASE=1}
|
|
||||||
$0 ~ p {print; exit}
|
|
||||||
')"
|
|
||||||
[ -z "$url" ] && {
|
[ -z "$url" ] && {
|
||||||
msg_error "asset not found for pattern: $pattern"
|
msg_error "asset not found for pattern: $pattern"
|
||||||
rm -rf "$tmpd"
|
rm -rf "$tmpd"
|
||||||
@ -431,10 +434,7 @@ fetch_and_deploy_gh_release() {
|
|||||||
rm -rf "$tmpd"
|
rm -rf "$tmpd"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
url="$(printf '%s' "$json" | jq -r '.assets[].browser_download_url' | awk -v p="$pattern" '
|
url=$(get_url "$pattern")
|
||||||
BEGIN{IGNORECASE=1}
|
|
||||||
$0 ~ p {print; exit}
|
|
||||||
')"
|
|
||||||
[ -z "$url" ] && {
|
[ -z "$url" ] && {
|
||||||
msg_error "asset not found for pattern: $pattern"
|
msg_error "asset not found for pattern: $pattern"
|
||||||
rm -rf "$tmpd"
|
rm -rf "$tmpd"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user