mirror of
https://github.com/Nezumi-2711/revanced-apk-build.git
synced 2026-09-22 13:38:52 +00:00
fix: resolve the utils logic
This commit is contained in:
@@ -100,20 +100,13 @@ get_rv_prebuilts() {
|
||||
if [ "$ver" = "dev" ]; then resp=$(jq -r '.[0]' <<<"$resp"); fi
|
||||
tag_name=$(jq -r '.tag_name' <<<"$resp")
|
||||
# Filter assets by extension and handle multiple matches
|
||||
# Use jq array syntax to get first match as a complete JSON object
|
||||
if [ "$ver" = "dev" ]; then
|
||||
# For dev version, prefer the one with "dev" in the name
|
||||
asset=$(jq -e -r ".assets[] | select(.name | endswith(\"$ext\") and contains(\"dev\"))" <<<"$resp" | head -1)
|
||||
# If no dev asset found, take any matching asset
|
||||
if [ -z "$asset" ]; then
|
||||
asset=$(jq -e -r ".assets[] | select(.name | endswith(\"$ext\"))" <<<"$resp" | head -1) || return 1
|
||||
fi
|
||||
asset=$(jq -e -r "[.assets[] | select(.name | endswith(\"$ext\") and contains(\"dev\"))][0] // [.assets[] | select(.name | endswith(\"$ext\"))][0]" <<<"$resp") || return 1
|
||||
else
|
||||
# For non-dev versions, exclude dev builds and take the first match
|
||||
asset=$(jq -e -r ".assets[] | select(.name | endswith(\"$ext\") and (contains(\"dev\") | not))" <<<"$resp" | head -1)
|
||||
# If no non-dev asset found, take any matching asset
|
||||
if [ -z "$asset" ]; then
|
||||
asset=$(jq -e -r ".assets[] | select(.name | endswith(\"$ext\"))" <<<"$resp" | head -1) || return 1
|
||||
fi
|
||||
asset=$(jq -e -r "[.assets[] | select(.name | endswith(\"$ext\") and (contains(\"dev\") | not))][0] // [.assets[] | select(.name | endswith(\"$ext\"))][0]" <<<"$resp") || return 1
|
||||
fi
|
||||
url=$(jq -r .url <<<"$asset")
|
||||
name=$(jq -r .name <<<"$asset")
|
||||
|
||||
Reference in New Issue
Block a user