Fix macOS build break (#10207)

This commit is contained in:
Travis Plunk 2019-07-22 15:21:38 -07:00 committed by GitHub
parent 260459ccd4
commit 6b2690ef8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1506,7 +1506,8 @@ function Install-Dotnet {
# Note that when it is null, Invoke-Expression (but not &) must be used to interpolate properly
$sudo = if (!$NoSudo) { "sudo" }
$obtainUrl = "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain"
$installObtainUrl = "https://dot.net/v1"
$uninstallObtainUrl = "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain"
# Install for Linux and OS X
if ($Environment.IsLinux -or $Environment.IsMacOS) {
@ -1519,7 +1520,7 @@ function Install-Dotnet {
if ($uninstallScript) {
Start-NativeExecution {
curl -sO $obtainUrl/uninstall/$uninstallScript
curl -sO $uninstallObtainUrl/uninstall/$uninstallScript
Invoke-Expression "$sudo bash ./$uninstallScript"
}
} else {
@ -1529,13 +1530,13 @@ function Install-Dotnet {
# Install new dotnet 1.1.0 preview packages
$installScript = "dotnet-install.sh"
Start-NativeExecution {
curl -sO $obtainUrl/$installScript
curl -sO $installObtainUrl/$installScript
bash ./$installScript -c $Channel -v $Version
}
} elseif ($Environment.IsWindows) {
Remove-Item -ErrorAction SilentlyContinue -Recurse -Force ~\AppData\Local\Microsoft\dotnet
$installScript = "dotnet-install.ps1"
Invoke-WebRequest -Uri $obtainUrl/$installScript -OutFile $installScript
Invoke-WebRequest -Uri $installObtainUrl/$installScript -OutFile $installScript
if (-not $Environment.IsCoreCLR) {
& ./$installScript -Channel $Channel -Version $Version