Skip to content

Commit 0027a3a

Browse files
committed
FileManager: Ignore .skipsPackageDescendants on all platforms
1 parent 639d608 commit 0027a3a

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

Foundation/FileManager.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,11 +1390,7 @@ extension FileManager {
13901390
if options.contains(.skipsSubdirectoryDescendants) {
13911391
skipDescendants = true
13921392
}
1393-
#if canImport(Darwin)
1394-
if options.contains(.skipsPackageDescendants) && filename.hasSuffix(".app") {
1395-
skipDescendants = true
1396-
}
1397-
#endif
1393+
// Ignore .skipsPackageDescendants
13981394
}
13991395
if options.contains(.skipsHiddenFiles) && (filename[filename._startOfLastPathComponent] == ".") {
14001396
showFile = false

TestFoundation/TestFileManager.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -478,10 +478,10 @@ class TestFileManager : XCTestCase {
478478
}
479479

480480
if let foundItems = directoryItems(options: [.skipsPackageDescendants]) {
481-
#if canImport(Darwin)
482-
XCTAssertEqual(foundItems.count, 10)
481+
#if DARWIN_COMPATIBILITY_TESTS
482+
XCTAssertEqual(foundItems.count, 10) // Only native Foundation does not gnore .skipsPackageDescendants
483483
#else
484-
XCTAssertEqual(foundItems.count, 15) // Non Darwin platforms ignore .skipsPackageDescendants
484+
XCTAssertEqual(foundItems.count, 15)
485485
#endif
486486
} else {
487487
XCTFail("Cant enumerate directory at \(basePath) with options: [.skipsHiddenFiles, .skipsSubdirectoryDescendants]")

0 commit comments

Comments
 (0)