fix: Use bash comparisons

This commit is contained in:
Sayantan Santra 2023-07-27 15:26:08 -05:00
parent 4bcb625392
commit 4b3551fc51
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F

View file

@ -32,9 +32,9 @@ req() { wget -nv -O "$2" --header="$WGET_HEADER" "$1"; }
# Returns if $1 is less than $2
ver_less_than() {
[ ${1:0:1} == "v" ] && var1=${1:1} || var1=$1
[ ${2:0:1} == "v" ] && var2=${2:1} || var2=$2
[ $(echo $var1$'\n'$var2 | sort -V | tail -n1) != $var1 ] && echo true || echo false
[[ ${1:0:1} == "v" ]] && var1=${1:1} || var1=$1
[[ ${2:0:1} == "v" ]] && var2=${2:1} || var2=$2
[[ $(echo $var1$'\n'$var2 | sort -V | tail -n1) != $var1 ]] && echo true || echo false
}
# Wget download apk