Skip to content

Commit

Permalink
Resolve symlinks in relative path method
Browse files Browse the repository at this point in the history
  • Loading branch information
swiftyfinch committed Nov 25, 2023
1 parent 4e94ae4 commit cb55bf4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/Implementation/Extensions/URL+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ extension URL {
var parent: URL { deletingLastPathComponent() }

func relativePath(to relativePath: String) -> String {
path.relativePath(to: relativePath)
let resolvedPath = resolvingSymlinksInPath().path
let resolvedRelativePath = URL(fileURLWithPath: relativePath).resolvingSymlinksInPath().path
return resolvedPath.relativePath(to: resolvedRelativePath)
}

func creationDate() throws -> Date {
Expand Down

0 comments on commit cb55bf4

Please sign in to comment.