mirror of
https://github.com/SinTan1729/ReVancedBuilder.git
synced 2024-12-26 20:58:37 -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
|
## Main
|
||||||
curl -X 'GET' 'https://releases.rvcd.win/patches' -H 'accept: application/json' -o patches.json
|
curl -X 'GET' 'https://releases.rvcd.win/patches' -H 'accept: application/json' -o patches.json
|
||||||
for apk in "${!apks[@]}"; do
|
for apk in "${!apks[@]}"; do
|
||||||
if [ ! -f $apk ]; then
|
|
||||||
echo "Downloading $apk" | tee -a build.log
|
echo "Downloading $apk" | tee -a build.log
|
||||||
supported_vers="$(jq -r '.[].compatiblePackages[] | select(.name == "'$apk'") | .versions | last' patches.json)"
|
supported_vers="$(jq -r '.[].compatiblePackages[] | select(.name == "'$apk'") | .versions | last' patches.json)"
|
||||||
version=0
|
version=0
|
||||||
for vers in $supported_vers; do
|
for vers in $supported_vers; do
|
||||||
if [ $vers != "null" ]; then
|
[ $vers != "null" ] && [[ $version==0 || ${vers//[!0-9]/} -lt ${version//[!0-9]/} ]] && version=$vers
|
||||||
if [[ $version==0 || ${vers//[!0-9]/} -lt ${version//[!0-9]/} ]]; then
|
|
||||||
version=$vers
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
version_present=$(jq -r ".\"$apk\"" versions.json)
|
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
|
[[ ${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
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue