mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-05-15 16:20:25 +00:00
fix fetch_release_and_deploy (#4478)
This commit is contained in:
parent
b4d98b1dd2
commit
e17f7aa6f1
@ -568,6 +568,7 @@ fetch_and_deploy_gh_release() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
tag=$(echo "$api_response" | jq -r '.tag_name // .name // empty')
|
tag=$(echo "$api_response" | jq -r '.tag_name // .name // empty')
|
||||||
|
[[ "$tag" =~ ^v[0-9] ]] && tag="${tag:1}"
|
||||||
version="${tag#v}"
|
version="${tag#v}"
|
||||||
|
|
||||||
if [[ -z "$tag" ]]; then
|
if [[ -z "$tag" ]]; then
|
||||||
@ -586,8 +587,8 @@ fetch_and_deploy_gh_release() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Version comparison (if we already have this version, skip)
|
# Version comparison (if we already have this version, skip)
|
||||||
if [[ "$current_version" == "$version" ]]; then
|
if [[ "$current_version" == "$tag" ]]; then
|
||||||
$STD msg_info "Already running the latest version ($version). Skipping update."
|
$STD msg_info "Already running the latest version ($tag). Skipping update."
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -650,8 +651,15 @@ fetch_and_deploy_gh_release() {
|
|||||||
|
|
||||||
# Final fallback to GitHub source tarball
|
# Final fallback to GitHub source tarball
|
||||||
if [[ -z "$url" ]]; then
|
if [[ -z "$url" ]]; then
|
||||||
url="https://github.com/$repo/archive/refs/tags/$version.tar.gz"
|
# Use tarball_url directly from API response instead of constructing our own URL
|
||||||
$STD msg_info "Trying GitHub source tarball fallback: $url"
|
url=$(echo "$api_response" | jq -r '.tarball_url // empty')
|
||||||
|
|
||||||
|
# If tarball_url is empty for some reason, fall back to a constructed URL as before
|
||||||
|
if [[ -z "$url" ]]; then
|
||||||
|
url="https://github.com/$repo/archive/refs/tags/v$version.tar.gz"
|
||||||
|
fi
|
||||||
|
|
||||||
|
$STD msg_info "Using GitHub source tarball: $url"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local filename="${url##*/}"
|
local filename="${url##*/}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user