From 5487dbaad90e49ff2133842932aff9e75e0a6a8d Mon Sep 17 00:00:00 2001 From: ilia-shipitsin <125650415+ilia-shipitsin@users.noreply.github.com> Date: Tue, 15 Aug 2023 15:23:02 +0200 Subject: [PATCH] use "license accept timeout" only on MacOS-13 (#8084) --- images/macos/helpers/Xcode.Installer.psm1 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/images/macos/helpers/Xcode.Installer.psm1 b/images/macos/helpers/Xcode.Installer.psm1 index 69c8c33d5..36aef42df 100644 --- a/images/macos/helpers/Xcode.Installer.psm1 +++ b/images/macos/helpers/Xcode.Installer.psm1 @@ -126,10 +126,17 @@ function Approve-XcodeLicense { [string]$Version ) + $os = Get-OSVersion + $XcodeRootPath = Get-XcodeRootPath -Version $Version Write-Host "Approving Xcode license for '$XcodeRootPath'..." $xcodeBuildPath = Get-XcodeToolPath -XcodeRootPath $XcodeRootPath -ToolName "xcodebuild" - Invoke-ValidateCommand -Command "sudo $xcodeBuildPath -license accept" -Timeout 15 + + if ($os.IsVentura -or $os.IsVenturaArm64) { + Invoke-ValidateCommand -Command "sudo $xcodeBuildPath -license accept" -Timeout 15 + } else { + Invoke-ValidateCommand -Command "sudo $xcodeBuildPath -license accept" + } } function Install-XcodeAdditionalPackages {