Skip to content

Commit f5bd75a

Browse files
authored
Find symlink managed swiftly when creating proxies (#367)
1 parent 5444f46 commit f5bd75a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sources/SwiftlyCore/Platform.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,13 @@ extension Platform {
450450
return swiftlyHomeBin
451451
}
452452

453+
// If swiftly is a symlink then something else, such as homebrew, is managing it.
454+
if cmdAbsolute != nil {
455+
if let _ = try? FileManager.default.destinationOfSymbolicLink(atPath: cmdAbsolute!) {
456+
return cmdAbsolute
457+
}
458+
}
459+
453460
let systemRoots: [FilePath] = ["/usr", "/opt", "/bin"]
454461

455462
// If we are system managed then we know where swiftly should be.

0 commit comments

Comments
 (0)