fix(tools): remove partial file before fallback download attempt

This commit is contained in:
CanbiZ (MickLesk) 2026-01-21 16:09:30 +01:00
parent 665907592e
commit fe9c5d2285

View File

@ -1778,6 +1778,8 @@ function fetch_and_deploy_gh_release() {
# Try primary URL first, fallback to codeload.github.com for complex tag names # Try primary URL first, fallback to codeload.github.com for complex tag names
if ! curl $download_timeout -fsSL -o "$tmpdir/$filename" "$direct_tarball_url" 2>/dev/null; then if ! curl $download_timeout -fsSL -o "$tmpdir/$filename" "$direct_tarball_url" 2>/dev/null; then
# Remove partial/corrupt file from failed attempt before retry
rm -f "$tmpdir/$filename"
# Fallback: codeload.github.com - only encode @ not / in tag names # Fallback: codeload.github.com - only encode @ not / in tag names
local codeload_encoded="${tag_name//@/%40}" local codeload_encoded="${tag_name//@/%40}"
local codeload_url="https://codeload.github.com/$repo/tar.gz/refs/tags/$codeload_encoded" local codeload_url="https://codeload.github.com/$repo/tar.gz/refs/tags/$codeload_encoded"