Do not download a pinned version of cli if it is already installed.
Fixes #1628
This commit is contained in:
parent
de89da6a3a
commit
3f43386d2a
1 changed files with 16 additions and 12 deletions
|
@ -174,21 +174,25 @@ install_dotnet()
|
||||||
|
|
||||||
if [ "$RELINK" = "0" ]; then
|
if [ "$RELINK" = "0" ]; then
|
||||||
if [ "$FORCE" = "0" ]; then
|
if [ "$FORCE" = "0" ]; then
|
||||||
# Check if we need to bother
|
|
||||||
local remoteData="$(curl -s https://dotnetcli.blob.core.windows.net/dotnet/$CHANNEL/dnvm/latest.$os.version)"
|
|
||||||
[ $? != 0 ] && say_err "Unable to determine latest version." && return 1
|
|
||||||
|
|
||||||
local remoteVersion=$(IFS="\n" && echo $remoteData | tail -n 1)
|
|
||||||
local remoteHash=$(IFS="\n" && echo $remoteData | head -n 1)
|
|
||||||
|
|
||||||
local localVersion=$(tail -n 1 "$installLocation/cli/.version" 2>/dev/null)
|
local localVersion=$(tail -n 1 "$installLocation/cli/.version" 2>/dev/null)
|
||||||
[ -z $localVersion ] && localVersion='<none>'
|
if [ "$VERSION" == "Latest" ]; then
|
||||||
local localHash=$(head -n 1 "$installLocation/cli/.version" 2>/dev/null)
|
# Check if we need to bother
|
||||||
|
local remoteData="$(curl -s https://dotnetcli.blob.core.windows.net/dotnet/$CHANNEL/dnvm/latest.$os.version)"
|
||||||
|
[ $? != 0 ] && say_err "Unable to determine latest version." && return 1
|
||||||
|
|
||||||
say "Latest Version: $remoteVersion"
|
local remoteVersion=$(IFS="\n" && echo $remoteData | tail -n 1)
|
||||||
say "Local Version: $localVersion"
|
local remoteHash=$(IFS="\n" && echo $remoteData | head -n 1)
|
||||||
|
|
||||||
[ "$remoteHash" = "$localHash" ] && say "${green}You already have the latest version.${normal}" && return 0
|
[ -z $localVersion ] && localVersion='<none>'
|
||||||
|
local localHash=$(head -n 1 "$installLocation/cli/.version" 2>/dev/null)
|
||||||
|
|
||||||
|
say "Latest Version: $remoteVersion"
|
||||||
|
say "Local Version: $localVersion"
|
||||||
|
|
||||||
|
[ "$remoteHash" = "$localHash" ] && say "${green}You already have the latest version.${normal}" && return 0
|
||||||
|
else
|
||||||
|
[ "$fileVersion" = "$localVersion" ] && say "${green}You already have the version $fileVersion.${normal}" && return 0
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#This should noop if the directory already exists.
|
#This should noop if the directory already exists.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue