Skip to content

Commit

Permalink
fix adding groups recursively
Browse files Browse the repository at this point in the history
  • Loading branch information
g-Off committed Jan 5, 2018
1 parent d74c819 commit 905dde9
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public extension PBXGroup {
return fileReference
}

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

if recursive {
let directories = missing.filter { $0.hasDirectoryPath }
let groups = directories.map {
directories.forEach {
addGroup(pathComponent: $0.lastPathComponent)
}

groups.forEach {
children.flatMap { $0 as? PBXGroup }.forEach {
$0.addMissingFiles(recursive: recursive, target: target)
}
}
Expand Down

0 comments on commit 905dde9

Please sign in to comment.