Skip to content

Commit ea402c8

Browse files
committed
Fixed some logic in PBXVariantGroup.
Try to make the logic simpler so that an error does not occur under the Linux environment.
1 parent b9359fb commit ea402c8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Sources/XcodeGenKit/PBXVariantGroupGenerator.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,13 @@ class PBXVariantGroupGenerator: TargetSourceFilterable {
113113
let pbxVariantGroupInfo = variantGroupInfoList
114114
.filter { $0.targetName == targetName }
115115
.first {
116-
let existsAlwaysStoredBaseFile = alwaysStoredBaseExtensions
117-
.reduce(into: [Bool]()) { $0.append(localizedChildPath.lastComponent.contains($1)) }
118-
.filter { $0 }
119-
.count > 0
116+
let existsAlwaysStoredBaseFile: Bool = {
117+
var containExtensionList: [Bool] = []
118+
alwaysStoredBaseExtensions.forEach { alwaysStoredBaseExtension in
119+
containExtensionList.append(localizedChildPath.lastComponent.contains(alwaysStoredBaseExtension))
120+
}
121+
return containExtensionList.filter { $0 }.count > 0
122+
}()
120123

121124
if existsAlwaysStoredBaseFile {
122125
return $0.path.lastComponentWithoutExtension == localizedChildPath.lastComponentWithoutExtension

0 commit comments

Comments
 (0)