mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
update_dart_sdk.ps1: Fall back to Invoke-WebRequest if BITS fails (#19873)
This commit is contained in:
parent
1b81b6127b
commit
154dbc5975
@ -43,8 +43,15 @@ if (Test-Path $dartSdkPath) {
|
||||
}
|
||||
New-Item $dartSdkPath -force -type directory | Out-Null
|
||||
$dartSdkZip = "$cachePath\$dartZipName"
|
||||
Import-Module BitsTransfer
|
||||
Start-BitsTransfer -Source $dartSdkUrl -Destination $dartSdkZip
|
||||
|
||||
Try {
|
||||
Import-Module BitsTransfer
|
||||
Start-BitsTransfer -Source $dartSdkUrl -Destination $dartSdkZip
|
||||
}
|
||||
Catch {
|
||||
Write-Host "Downloading the Dart SDK using the BITS service failed, retrying with WebRequest..."
|
||||
Invoke-WebRequest -Uri $dartSdkUrl -OutFile $dartSdkZip
|
||||
}
|
||||
|
||||
Write-Host "Unzipping Dart SDK..."
|
||||
If (Get-Command 7z -errorAction SilentlyContinue) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user