Skip to content

Commit 0f7d7a8

Browse files
[macos] download XCode installer with retries (#7898)
1 parent 21597cf commit 0f7d7a8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

images/macos/helpers/Xcode.Installer.psm1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function Install-XcodeVersion {
1111
$xcodeDownloadDirectory = "$env:HOME/Library/Caches/XcodeInstall"
1212
$xcodeTargetPath = Get-XcodeRootPath -Version $LinkTo
1313
$xcodeXipDirectory = Invoke-DownloadXcodeArchive -DownloadDirectory $xcodeDownloadDirectory -Version $Version
14-
Expand-XcodeXipArchive -DownloadDirectory $xcodeXipDirectory -TargetPath $xcodeTargetPath
14+
Expand-XcodeXipArchive -DownloadDirectory $xcodeXipDirectory.FullName -TargetPath $xcodeTargetPath
1515

1616
Remove-Item -Path $xcodeXipDirectory -Force -Recurse
1717
}
@@ -31,8 +31,7 @@ function Invoke-DownloadXcodeArchive {
3131
$xcodeFileName = 'Xcode-{0}.xip' -f $Version
3232
$xcodeUri = '{0}{1}{2}'-f ${env:XCODE_INSTALL_STORAGE_URL}, $xcodeFileName, ${env:XCODE_INSTALL_SAS}
3333

34-
Invoke-WebRequest -Uri $xcodeUri -OutFile (Join-Path $tempXipDirectory $xcodeFileName)
35-
34+
Start-DownloadWithRetry -Url $xcodeUri -DownloadPath $tempXipDirectory.FullName -Name $xcodeFileName
3635
return $tempXipDirectory
3736

3837
}

0 commit comments

Comments
 (0)