Add reveal in finder to copyable (#669)

This commit is contained in:
Max Goedjen
2025-09-03 23:36:50 -07:00
committed by GitHub
parent 74f4f1c0b1
commit 3d5f0b45bd
4 changed files with 41 additions and 11 deletions

View File

@@ -40,10 +40,7 @@ struct ConfigurationItemView<Content: View>: View {
.buttonStyle(.borderless)
case .revealInFinder(let rawPath):
Button(.revealInFinderButton, systemImage: "folder") {
// All foundation-based normalization methods replace this with the container directly.
let processedPath = rawPath.replacingOccurrences(of: "~", with: "/Users/\(NSUserName())")
let url = URL(filePath: processedPath)
let folder = url.deletingLastPathComponent().path()
let (processedPath, folder) = rawPath.normalizedPathAndFolder
NSWorkspace.shared.selectFile(processedPath, inFileViewerRootedAtPath: folder)
}
.labelStyle(.iconOnly)