mirror of
https://github.com/SinTan1729/ReVancedBuilder.git
synced 2024-12-27 05:08:35 -06:00
Cleaner version comparison
This commit is contained in:
parent
82c64f8c84
commit
63aae8c589
1 changed files with 4 additions and 3 deletions
|
@ -23,9 +23,10 @@ patch_file="$WDIR./chosen_patches.txt"
|
||||||
|
|
||||||
# Returns if $1 is less than $2
|
# Returns if $1 is less than $2
|
||||||
ver_less_than() {
|
ver_less_than() {
|
||||||
[ ${1:0:1} == "v" ] && var1=${1:1} || var1=$1
|
# Strip letters from version name
|
||||||
[ ${2:0:1} == "v" ] && var2=${2:1} || var2=$2
|
ver1=$(echo $1 | sed 's/[a-zA-Z]*//g')
|
||||||
[ $(echo $var1$'\n'$var2 | sort -V | tail -n1) != $var1 ] && echo true || echo false
|
ver2=$(echo $2 | sed 's/[a-zA-Z]*//g')
|
||||||
|
[ $(echo $ver1$'\n'$ver2 | sort -V | tail -n1) != $ver1 ] && echo true || echo false
|
||||||
}
|
}
|
||||||
|
|
||||||
# Make sure to work in the script directory
|
# Make sure to work in the script directory
|
||||||
|
|
Loading…
Reference in a new issue