fix: When starting from scratch

This commit is contained in:
Sayantan Santra 2023-07-28 12:02:31 -05:00
parent f27d503105
commit 86c29d9b6d
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F
2 changed files with 3 additions and 3 deletions

View file

@ -114,7 +114,7 @@ if [[ $2 != buildonly ]]; then
basename=$(echo $repo | cut -d '/' -f2) basename=$(echo $repo | cut -d '/' -f2)
echo "Checking $basename" echo "Checking $basename"
version_present=$(jq -r ".\"$basename\"" versions.json) version_present=$(jq -r ".\"$basename\"" versions.json)
[ -z "$version_present" ] && version_present=0 [[ "$version_present" == "null" ]] && version_present=0
data="$(jq -r ".tools[] | select((.repository == \"$repo\") and (.content_type | contains(\"archive\")))" latest_versions.json)" data="$(jq -r ".tools[] | select((.repository == \"$repo\") and (.content_type | contains(\"archive\")))" latest_versions.json)"
[[ $name == microg.apk ]] && version=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | jq -r '.tag_name') || version=$(echo "$data" | jq -r '.version') [[ $name == microg.apk ]] && version=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | jq -r '.tag_name') || version=$(echo "$data" | jq -r '.version')
if [[ $(ver_less_than $version_present $version) == true || ! -f $name || $2 == force ]]; then if [[ $(ver_less_than $version_present $version) == true || ! -f $name || $2 == force ]]; then

View file

@ -142,8 +142,8 @@ for apk in "${!apks[@]}"; do
done done
version_present=$(jq -r ".\"$apk\"" versions.json) version_present=$(jq -r ".\"$apk\"" versions.json)
[ -z "$version_present" ] && version_present=0 [[ -z "$version_present" || "$version" == "null" ]] && version_present=0
[[ "$version" == "0" ]] && version=latest [[ "$version" == "0" ]] && version=latest
[[ $(ver_less_than $version_present $version) == true || ! -f $apk.apk || $2 == force ]] && ${apks[$apk]} || echo "Recommended version ($version_present) of "$apk" is already present" [[ $(ver_less_than $version_present $version) || ! -f $apk.apk || $2 == force ]] && ${apks[$apk]} || echo "Recommended version ($version_present) of "$apk" is already present"
done done