mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[macOS] Rebuilding Launch Services database (#4588)
This commit is contained in:
@@ -175,6 +175,17 @@ function Build-XcodeSymlinks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Rebuild-XcodeLaunchServicesDb {
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory)]
|
||||||
|
[string]$Version
|
||||||
|
)
|
||||||
|
|
||||||
|
$xcodePath = Get-XcodeRootPath -Version $Version
|
||||||
|
$lsregister = '/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister'
|
||||||
|
Get-ChildItem -Recurse -Filter "*.app" $xcodePath | Foreach-Object { & $lsregister -f $_.FullName}
|
||||||
|
}
|
||||||
|
|
||||||
function Build-ProvisionatorSymlink {
|
function Build-ProvisionatorSymlink {
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory)]
|
[Parameter(Mandatory)]
|
||||||
|
|||||||
@@ -51,6 +51,11 @@ $xcodeVersions | ForEach-Object {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Write-Host "Rebuilding Launch Services database ..."
|
||||||
|
$xcodeVersions | ForEach-Object {
|
||||||
|
Rebuild-XcodeLaunchServicesDb -Version $_.link
|
||||||
|
}
|
||||||
|
|
||||||
Write-Host "Setting default Xcode to $defaultXcode"
|
Write-Host "Setting default Xcode to $defaultXcode"
|
||||||
Switch-Xcode -Version $defaultXcode
|
Switch-Xcode -Version $defaultXcode
|
||||||
New-Item -Path "/Applications/Xcode.app" -ItemType SymbolicLink -Value (Get-XcodeRootPath -Version $defaultXcode) | Out-Null
|
New-Item -Path "/Applications/Xcode.app" -ItemType SymbolicLink -Value (Get-XcodeRootPath -Version $defaultXcode) | Out-Null
|
||||||
|
|||||||
Reference in New Issue
Block a user