fix: Handle when no version is present

This commit is contained in:
Sayantan Santra 2023-07-27 15:40:15 -05:00
parent c0c01663df
commit 530786a7e8
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F

View file

@ -131,5 +131,6 @@ for apk in "${!apks[@]}"; do
[ $vers != "null" ] && [[ $(ver_less_than $vers $version) == true || $version == 0 ]] && version=$vers [ $vers != "null" ] && [[ $(ver_less_than $vers $version) == true || $version == 0 ]] && version=$vers
done done
version_present=$(jq -r ".\"$apk\"" versions.json) version_present=$(jq -r ".\"$apk\"" versions.json)
[ -z "$version_present" ] && version_present=0
[[ $(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) == true || ! -f $apk.apk || $2 == force ]] && ${apks[$apk]} || echo "Recommended version ($version_present) of "$apk" is already present"
done done