mirror of
https://github.com/SinTan1729/ReVancedBuilder.git
synced 2024-12-26 12:48:36 -06:00
Fix apk download logic
This commit is contained in:
parent
6472f4c01e
commit
5b20f11739
1 changed files with 8 additions and 14 deletions
|
@ -91,18 +91,12 @@ fi
|
|||
## Main
|
||||
curl -X 'GET' 'https://releases.rvcd.win/patches' -H 'accept: application/json' -o patches.json
|
||||
for apk in "${!apks[@]}"; do
|
||||
if [ ! -f $apk ]; then
|
||||
echo "Downloading $apk" | tee -a build.log
|
||||
supported_vers="$(jq -r '.[].compatiblePackages[] | select(.name == "'$apk'") | .versions | last' patches.json)"
|
||||
version=0
|
||||
for vers in $supported_vers; do
|
||||
if [ $vers != "null" ]; then
|
||||
if [[ $version==0 || ${vers//[!0-9]/} -lt ${version//[!0-9]/} ]]; then
|
||||
version=$vers
|
||||
fi
|
||||
fi
|
||||
[ $vers != "null" ] && [[ $version==0 || ${vers//[!0-9]/} -lt ${version//[!0-9]/} ]] && version=$vers
|
||||
done
|
||||
version_present=$(jq -r ".\"$apk\"" versions.json)
|
||||
[[ ${version_present//[!0-9]/} -lt ${version//[!0-9]/} ]] && ${apks[$apk]} || echo "Recommended version of "$apk" is already present" | tee -a build.log
|
||||
fi
|
||||
[[ ${version_present//[!0-9]/} -lt ${version//[!0-9]/} || ! -f $apk.apk ]] && ${apks[$apk]} || echo "Recommended version of "$apk" is already present" | tee -a build.log
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue