Skip to content

Commit c76127a

Browse files
authored
Fix recursive children (#235)
Following symlink shouldn't imply recursive
1 parent eeff35b commit c76127a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## master
22

3+
- Fix a bug where `children` always recusively visit its content when following symlinks.
4+
35
## 0.3.1
46

57
- children() can follow symlinks found in the content if `followSymlink`

Sources/Pathos/children.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public func children(inPath path: String, recursive: Bool = false, followSymlink
4848
let realName = try? realPath(ofPath: fullName),
4949
(try? isA(.directory, atPath: realName)) == true
5050
{
51-
result += try children(inPath: fullName, recursive: true)
51+
result += try children(inPath: fullName, recursive: recursive)
5252
} else if recursive && pathType == .directory {
5353
result += try children(inPath: fullName, recursive: true)
5454
}

0 commit comments

Comments
 (0)