Skip to content

Commit 905dde9

Browse files
committed
fix adding groups recursively
1 parent d74c819 commit 905dde9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Sources/XcodeProject/Objects+Extensions/PBXGroup+FolderSync.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public extension PBXGroup {
3232
return fileReference
3333
}
3434

35+
@discardableResult
3536
func addGroup(pathComponent: String) -> PBXGroup {
3637
let group = PBXGroup(globalID: PBXObject.ID(), name: nil, path: pathComponent, sourceTree: .group)
3738
children.append(group)
@@ -107,11 +108,10 @@ public extension PBXGroup {
107108

108109
if recursive {
109110
let directories = missing.filter { $0.hasDirectoryPath }
110-
let groups = directories.map {
111+
directories.forEach {
111112
addGroup(pathComponent: $0.lastPathComponent)
112113
}
113-
114-
groups.forEach {
114+
children.flatMap { $0 as? PBXGroup }.forEach {
115115
$0.addMissingFiles(recursive: recursive, target: target)
116116
}
117117
}

0 commit comments

Comments
 (0)