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.