mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 04:37:09 +00:00
[macOS] Remove sudo from sims installer script (#11880)
This commit is contained in:
@@ -192,7 +192,7 @@ function Install-AdditionalSimulatorRuntimes {
|
|||||||
# Install all runtimes / skip runtimes
|
# Install all runtimes / skip runtimes
|
||||||
if ($Runtimes -eq "default") {
|
if ($Runtimes -eq "default") {
|
||||||
Write-Host "Installing all runtimes for Xcode $Version ..."
|
Write-Host "Installing all runtimes for Xcode $Version ..."
|
||||||
Invoke-ValidateCommand "sudo $xcodebuildPath -downloadAllPlatforms" | Out-Null
|
Invoke-ValidateCommand "$xcodebuildPath -downloadAllPlatforms" | Out-Null
|
||||||
return
|
return
|
||||||
} elseif ($Runtimes -eq "none") {
|
} elseif ($Runtimes -eq "none") {
|
||||||
Write-Host "Skipping runtimes installation for Xcode $Version ..."
|
Write-Host "Skipping runtimes installation for Xcode $Version ..."
|
||||||
@@ -239,14 +239,14 @@ function Install-AdditionalSimulatorRuntimes {
|
|||||||
}
|
}
|
||||||
"default" {
|
"default" {
|
||||||
Write-Host "Installing default $platform runtime for Xcode $Version ..."
|
Write-Host "Installing default $platform runtime for Xcode $Version ..."
|
||||||
Invoke-ValidateCommand "sudo $xcodebuildPath -downloadPlatform $platform" | Out-Null
|
Invoke-ValidateCommand "$xcodebuildPath -downloadPlatform $platform" | Out-Null
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
default {
|
default {
|
||||||
# Version might be a semver or a build number
|
# Version might be a semver or a build number
|
||||||
if (($platformVersion -match "^\d{1,2}\.\d(\.\d)?$") -or ($platformVersion -match "^[a-zA-Z0-9]{6,8}$")) {
|
if (($platformVersion -match "^\d{1,2}\.\d(\.\d)?$") -or ($platformVersion -match "^[a-zA-Z0-9]{6,8}$")) {
|
||||||
Write-Host "Installing $platform $platformVersion runtime for Xcode $Version ..."
|
Write-Host "Installing $platform $platformVersion runtime for Xcode $Version ..."
|
||||||
Invoke-ValidateCommand "sudo $xcodebuildPath -downloadPlatform $platform -buildVersion $platformVersion" | Out-Null
|
Invoke-ValidateCommand "$xcodebuildPath -downloadPlatform $platform -buildVersion $platformVersion" | Out-Null
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
throw "$platformVersion is not a valid value for $platform version. Valid values are 'latest' or 'skip' or a semver from 0.0 to 99.9.(9)."
|
throw "$platformVersion is not a valid value for $platform version. Valid values are 'latest' or 'skip' or a semver from 0.0 to 99.9.(9)."
|
||||||
|
|||||||
Reference in New Issue
Block a user