File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -23,12 +23,12 @@ import Foundation
2323/// Returns the "real path" corresponding to `path` by resolving any symbolic links.
2424public func resolveSymlinks( _ path: AbsolutePath ) -> AbsolutePath {
2525#if os(Windows)
26- let resolved : String =
27- ( try ? FileManager . default. destinationOfSymbolicLink ( atPath: path. pathString) )
28- ?? path. pathString
26+ var resolved : URL = URL ( fileURLWithPath: path. pathString)
27+ if let destination = try ? FileManager . default. destinationOfSymbolicLink ( atPath: path. pathString) {
28+ resolved = URL ( fileURLWithPath: destination, relativeTo: URL ( fileURLWithPath: path. pathString) )
29+ }
2930
30- return URL ( fileURLWithPath: resolved. standardizingPath)
31- . withUnsafeFileSystemRepresentation {
31+ return resolved. standardized. withUnsafeFileSystemRepresentation {
3232 try ! AbsolutePath ( validating: String ( cString: $0!) )
3333 }
3434#else
You can’t perform that action at this time.
0 commit comments