File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -23,12 +23,12 @@ import Foundation
23
23
/// Returns the "real path" corresponding to `path` by resolving any symbolic links.
24
24
public func resolveSymlinks( _ path: AbsolutePath ) -> AbsolutePath {
25
25
#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
+ }
29
30
30
- return URL ( fileURLWithPath: resolved. standardizingPath)
31
- . withUnsafeFileSystemRepresentation {
31
+ return resolved. standardized. withUnsafeFileSystemRepresentation {
32
32
try ! AbsolutePath ( validating: String ( cString: $0!) )
33
33
}
34
34
#else
You can’t perform that action at this time.
0 commit comments