Apparently, the previous commit have few problems with version check, especially when the current version have a lower start and higher end or vice versa.
To make sure this commit will fix the issue, here is a test script:
#!/usr/bin/env bash
CURRENT="470.44.10"
LATEST="471.55.10"
if [ "$(printf '%s\n' "$LATEST" "$CURRENT" | sort -V | head -n1)" != "$LATEST" ]; then
echo "CURRENT VERSION IS LESS THAN ${LATEST}"
else
echo "CURRENT VERSION IS EQUAL OR GREATER THAN ${LATEST}"
fi
changing the CURRENT variable from 470 to 480 or from .11 to .50 shouldn't change how the script compare the versions. (This applies if you change the LATEST variable values)
Hopefully this fixes all the issues with the version check and apologies for the last commit.
Apparently, the previous commit have few problems with version check, especially when the current version have a lower start and higher end or vice versa.
To make sure this commit will fix the issue, here is a test script:
changing the
CURRENT
variable from 470 to 480 or from .11 to .50 shouldn't change how the script compare the versions. (This applies if you change theLATEST
variable values)Hopefully this fixes all the issues with the version check and apologies for the last commit.