Skip to content

Commit f29c1c4

Browse files
committed
♻️ ignoring some folders
1 parent 8c516bb commit f29c1c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

LocalizationEditor/Providers/LocalizationProvider.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ import Files
1111
import Foundation
1212

1313
class LocalizationProvider {
14+
private let ignoredDirectories = ["Carthage", "build", ".framework"]
15+
1416
func getLocalizations(url: URL) -> [Localization] {
1517
Log.debug?.message("Searching \(url) for Localizable.strings")
1618

1719
guard let folder = try? Folder(path: url.path) else {
1820
return []
1921
}
2022

21-
let localizationFiles = folder.makeFileSequence(recursive: true).filter({ $0.name == "Localizable.strings" })
23+
let localizationFiles = folder.makeFileSequence(recursive: true).filter { file in
24+
return file.name == "Localizable.strings" && ignoredDirectories.map({file.path.contains("\($0)/")}).filter({$0}).count == 0
25+
}
2226

2327
Log.debug?.message("Found \(localizationFiles) localization files")
2428

0 commit comments

Comments
 (0)