File tree Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Expand file tree Collapse file tree 1 file changed +1
-12
lines changed Original file line number Diff line number Diff line change 17
17
while making it fairly easy to find those calls later.
18
18
*/
19
19
20
- import SPMLibc
21
20
import Foundation
22
21
23
22
/// Returns the "real path" corresponding to `path` by resolving any symbolic links.
24
23
public func resolveSymlinks( _ path: AbsolutePath ) -> AbsolutePath {
25
- let pathStr = path. pathString
26
-
27
- // FIXME: We can't use FileManager's destinationOfSymbolicLink because
28
- // that implements readlink and not realpath.
29
- if let resultPtr = SPMLibc . realpath ( pathStr, nil ) {
30
- let result = String ( cString: resultPtr)
31
- // FIXME: We should measure if it's really more efficient to compare the strings first.
32
- return result == pathStr ? path : AbsolutePath ( result)
33
- }
34
-
35
- return path
24
+ return AbsolutePath ( path. pathString. resolvingSymlinksInPath)
36
25
}
37
26
38
27
/// Creates a new, empty directory at `path`. If needed, any non-existent ancestor paths are also created. If there is
You can’t perform that action at this time.
0 commit comments