Skip to content

Commit f824817

Browse files
committed
Fix relative symlinks when using --follow-symlinks
1 parent 1e72780 commit f824817

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/SwiftFormat/Utilities/FileIterator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public struct FileIterator: Sequence, IteratorProtocol {
7979
else {
8080
break
8181
}
82-
next = URL(fileURLWithPath: destination)
82+
next = URL(fileURLWithPath: destination, relativeTo: next)
8383
fallthrough
8484

8585
case .typeDirectory:
@@ -135,7 +135,7 @@ public struct FileIterator: Sequence, IteratorProtocol {
135135
else {
136136
break
137137
}
138-
path = destination
138+
path = URL(fileURLWithPath: destination, isDirectory: false, relativeTo: item).path
139139
fallthrough
140140

141141
case .typeRegular:

0 commit comments

Comments
 (0)