Compare commits

..

No commits in common. "2b50e8dc952531db85bdaffc1a7542f06f3de090" and "1b03d6113da37b74c15a06e1da78b0d81516fd06" have entirely different histories.

View File

@ -881,43 +881,37 @@ function fetch_and_deploy_gh_release() {
cp -r "$unpack_dir"/* "$target/" cp -r "$unpack_dir"/* "$target/"
shopt -u dotglob nullglob shopt -u dotglob nullglob
### Binary Mode ### ### Binary Mode ###
elif [[ "$mode" == "binary" ]]; then elif [[ "$mode" == "binary" ]]; then
local arch local arch
arch=$(dpkg --print-architecture 2>/dev/null || uname -m) arch=$(dpkg --print-architecture 2>/dev/null || uname -m)
[[ "$arch" == "x86_64" ]] && arch="amd64" [[ "$arch" == "x86_64" ]] && arch="amd64"
[[ "$arch" == "aarch64" ]] && arch="arm64" #[[ "$arch" == "aarch64" ]] && arch="arm64"
local assets url_match="" local assets url_match=""
assets=$(echo "$json" | jq -r '.assets[].browser_download_url') assets=$(echo "$json" | jq -r '.assets[].browser_download_url')
# 1. Expliziten Pattern-Parameter bevorzugen # If explicit filename pattern is provided (param $6), match that first
if [[ -n "$asset_pattern" ]]; then if [[ -n "$asset_pattern" ]]; then
for u in $assets; do for u in $assets; do
if [[ "$u" =~ $asset_pattern || "$u" == *"$asset_pattern" ]]; then [[ "$u" =~ $asset_pattern || "$u" == *"$asset_pattern" ]] && url_match="$u" && break
done
fi
# If no match via explicit pattern, fall back to architecture heuristic
if [[ -z "$url_match" ]]; then
for u in $assets; do
if [[ "$u" =~ ($arch|amd64|x86_64|aarch64|arm64).*\.deb$ ]]; then
url_match="$u" url_match="$u"
break break
fi fi
done done
fi fi
# 2. Wenn kein Pattern-Match, gezielt nach Architektur suchen # Fallback: any .deb file
if [[ -z "$url_match" ]]; then if [[ -z "$url_match" ]]; then
for u in $assets; do for u in $assets; do
if [[ "$u" == *"${arch}"* && "$u" == *.deb ]]; then [[ "$u" =~ \.deb$ ]] && url_match="$u" && break
url_match="$u"
break
fi
done
fi
# 3. Fallback: irgendein .deb
if [[ -z "$url_match" ]]; then
for u in $assets; do
if [[ "$u" == *.deb ]]; then
url_match="$u"
break
fi
done done
fi fi