- __DOTNET_LOCATION="https://dotnetcli.azureedge.net/dotnet/Sdk/${__DOTNET_TOOLS_VERSION}/${__DOTNET_PKG}.tar.gz"
- # curl has HTTPS CA trust-issues less often than wget, so lets try that first.
- echo "Installing '${__DOTNET_LOCATION}' to '$__DOTNET_PATH/dotnet.tar'" >> $__init_tools_log
- if command -v curl > /dev/null; then
- curl --retry 10 -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
- else
- wget -q -O $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
- fi
- cd $__DOTNET_PATH
- tar -xf $__DOTNET_PATH/dotnet.tar
+ __DOTNET_LOCATION="https://dotnetcli.azureedge.net/dotnet/Sdk/${__DOTNET_TOOLS_VERSION}/${__DOTNET_PKG}.tar.gz"
+
+ install_dotnet_cli() {
+ echo "Installing '${__DOTNET_LOCATION}' to '$__DOTNET_PATH/dotnet.tar'" >> "$__init_tools_log"
+ rm -rf -- "$__DOTNET_PATH/*"
+ # curl has HTTPS CA trust-issues less often than wget, so lets try that first.
+ if command -v curl > /dev/null; then
+ curl --retry 10 -sSL --create-dirs -o $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
+ else
+ wget -q -O $__DOTNET_PATH/dotnet.tar ${__DOTNET_LOCATION}
+ fi
+ cd $__DOTNET_PATH
+ tar -xf $__DOTNET_PATH/dotnet.tar
+ }
+ execute_with_retry install_dotnet_cli >> "$__init_tools_log" 2>&1