[macOS] Rebuilding Launch Services database (#4588)

This commit is contained in:
Sergey Dolin
2021-12-01 12:58:26 +05:00
committed by GitHub
parent f4306a6c40
commit 6f662479c8
2 changed files with 17 additions and 1 deletions

View File

@@ -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 {
param(
[Parameter(Mandatory)]
@@ -216,4 +227,4 @@ function Set-XcodeDeveloperDirEnvironmentVariables {
Write-Host "Set ${variableName}=${variableValue}"
"export ${variableName}=${variableValue}" | Out-File "$env:HOME/.bashrc" -Append
}
}
}