From bf772203739ed559f63582fb1da2f059eb890d34 Mon Sep 17 00:00:00 2001 From: Chris McGee Date: Mon, 26 May 2025 20:10:49 -0400 Subject: [PATCH] Find symlink managed swiftly when creating proxies --- Sources/SwiftlyCore/Platform.swift | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Sources/SwiftlyCore/Platform.swift b/Sources/SwiftlyCore/Platform.swift index 9ab2ad4d..63d3dff2 100644 --- a/Sources/SwiftlyCore/Platform.swift +++ b/Sources/SwiftlyCore/Platform.swift @@ -450,6 +450,13 @@ extension Platform { return swiftlyHomeBin } + // If swiftly is a symlink then something else, such as homebrew, is managing it. + if cmdAbsolute != nil { + if let _ = try? FileManager.default.destinationOfSymbolicLink(atPath: cmdAbsolute!) { + return cmdAbsolute + } + } + let systemRoots: [FilePath] = ["/usr", "/opt", "/bin"] // If we are system managed then we know where swiftly should be.