Skip to content

Commit

Permalink
devonfw#690: improved version comparision
Browse files Browse the repository at this point in the history
  • Loading branch information
cinnamon-coder-hub committed May 24, 2022
1 parent d94cf3e commit ee77d5e
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions scripts/src/main/resources/scripts/command/docker
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,18 @@ function doSetup() {
fi
else
doRequireNotBatch
local latestversion
latestversion=$(curl -Ls -o /dev/null -w '%{url_effective}' https://github.com/rancher-sandbox/rancher-desktop/releases/latest | sed 's/.*\([0-9]\.[0-9]\.[0-9]\).*/\1/')
local previousversion="1.2.1"
if [[ "${latestversion}" =~ ^[0-9]\.[0-9].[0-9]$ ]]
then
if [ "${latestversion}" \> "${previousversion}" ]
local version="${RANCHER_VERSION}"
if [ -z "${version}" ]
then
version=1.3.0
latestversion=$(curl -Ls -o /dev/null -w '%{url_effective}' https://github.com/rancher-sandbox/rancher-desktop/releases/latest | sed 's/.*\([0-9]\.[0-9]\.[0-9]\).*/\1/')
doVersionCompare "${latestversion}" "${version}"
VersCompRes=${?}
if [ "${VersCompRes}" = 1 ]
then
doEcho "setting RANCHER_VERSION"
RANCHER_VERSION=${latestversion}
doEcho "RANCHER_VERSION is ${RANCHER_VERSION}"
version=${latestversion}
fi
fi
local version="${RANCHER_VERSION:-1.2.1}"
local code
#to download Rancher Desktop we need a bit more work compared to Docker-Desktop
#as the download-URL isn't well structured
Expand Down

0 comments on commit ee77d5e

Please sign in to comment.