Skip to content

Commit d7f7c78

Browse files
committed
chore: add retry for curl that download dotnet-install.sh
1 parent 9612c51 commit d7f7c78

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

build/build.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ if ($PSVersionTable.PSEdition -ne 'Core') {
2020
}
2121
}
2222

23+
# Temporary remove curl alias.
24+
Remove-Item alias:curl
25+
2326
###########################################################################
2427
# INSTALL .NET CORE CLI
2528
###########################################################################
@@ -55,7 +58,9 @@ $GlobalJsonPath = Join-Path $SdkPath "global.json"
5558
if (!(Test-Path $InstallPath)) {
5659
New-Item -Path $InstallPath -ItemType Directory -Force | Out-Null;
5760
$ScriptPath = Join-Path $InstallPath 'dotnet-install.ps1'
58-
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallerUri, $ScriptPath);
61+
62+
curl -LsSfo $ScriptPath $DotNetInstallerUri --retry 5 --retry-delay 5
63+
5964
& $ScriptPath -JSonFile $GlobalJsonPath -InstallDir $InstallPath;
6065

6166
# Install .NET 8 SDK

build/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0
1313

1414
if [ ! -d "$PROJECT_ROOT/.dotnet" ]; then
1515
mkdir "$PROJECT_ROOT/.dotnet"
16-
curl -Lsfo "$PROJECT_ROOT/.dotnet/dotnet-install.sh" https://dot.net/v1/dotnet-install.sh
16+
curl -LsSfo "$PROJECT_ROOT/.dotnet/dotnet-install.sh" https://dot.net/v1/dotnet-install.sh --retry 5 --retry-delay 5
1717
bash "$PROJECT_ROOT/.dotnet/dotnet-install.sh" --jsonfile ./build/sdk/global.json --install-dir .dotnet --no-path
1818

1919
# Install .NET 8 SDK

0 commit comments

Comments
 (0)