Skip to content

Commit 6e1eeb1

Browse files
committed
No fatal on linux Swift < 5
1 parent 260196a commit 6e1eeb1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Sources/Path+ls.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,11 @@ public extension Path.Finder {
130130
while let path = next() {
131131
switch try closure(path) {
132132
case .skip:
133+
#if !os(Linux) || swift(>=5.0)
133134
enumerator.skipDescendants()
135+
#else
136+
fputs("warning: skip is not implemented for Swift < 5.0\n", stderr)
137+
#endif
134138
case .abort:
135139
return
136140
case .continue:

Tests/PathTests/PathTests+ls().swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ extension PathTests {
169169
try tmpdir.b.mkdir().join("c").touch()
170170
try tmpdir.b.d.mkdir().join("e").touch()
171171
try tmpdir.b.d.f.mkdir().join("g").touch()
172-
172+
#if !os(Linux) || swift(>=5)
173173
do {
174174
var rv = Set<Path>()
175175

@@ -184,6 +184,7 @@ extension PathTests {
184184

185185
XCTAssertEqual(rv, Set([tmpdir.a, tmpdir.b, tmpdir.b.c].map(Path.init)))
186186
}
187+
#endif
187188
do {
188189
var x = 0
189190

0 commit comments

Comments
 (0)