Files
burstein 777aef5959 Supported subdirectories in integration tests data
commit_hash:a8efe4fbf4f156ff212dca5cb3316d4d9770e004
2025-06-16 13:36:25 +03:00

13 lines
437 B
Swift

import Foundation
func getFiles(_ path: String, forBundle bundle: Bundle) -> [URL] {
guard let enumerator = FileManager.default.enumerator(
atPath: bundle.path(forResource: path, ofType: nil)!
) else { return [] }
return enumerator.compactMap {
guard let fileName = $0 as? String, fileName.hasSuffix(".json") else { return nil }
return bundle.url(forResource: fileName, withExtension: nil, subdirectory: path)!
}
}