Skip to content

Commit

Permalink
No fatal on linux Swift < 5
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Jan 25, 2020
1 parent 070ba2d commit fba7a02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Sources/Path+ls.swift
Expand Up @@ -128,7 +128,11 @@ public extension Path.Finder {
while let path = next() {
switch try closure(path) {
case .skip:
#if !os(Linux) || swift(>=5.0)
enumerator.skipDescendants()
#else
fputs("warning: skip is not implemented for Swift < 5.0\n", stderr)
#endif
case .abort:
return
case .continue:
Expand Down
3 changes: 2 additions & 1 deletion Tests/PathTests/PathTests+ls().swift
Expand Up @@ -158,7 +158,7 @@ extension PathTests {
try tmpdir.b.mkdir().join("c").touch()
try tmpdir.b.d.mkdir().join("e").touch()
try tmpdir.b.d.f.mkdir().join("g").touch()

#if !os(Linux) || swift(>=5)
do {
var rv = Set<Path>()

Expand All @@ -173,6 +173,7 @@ extension PathTests {

XCTAssertEqual(rv, Set([tmpdir.a, tmpdir.b, tmpdir.b.c].map(Path.init)))
}
#endif
do {
var x = 0

Expand Down

0 comments on commit fba7a02

Please sign in to comment.