Skip to content

Commit 8e49dd8

Browse files
committed
Fix bugs in add_file_to_xcodeproj
1 parent d82f21d commit 8e49dd8

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

submodules/libsixel

tools/add_file_to_xcodeproj.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ def find_or_create_group(project, file_path)
8585
current_group = project.main_group
8686

8787
components.each do |component|
88-
# Look for existing group
89-
child = current_group.children.find { |c| c.is_a?(Xcodeproj::Project::Object::PBXGroup) && c.name == component }
90-
91-
# Also check by path if name doesn't match
92-
child ||= current_group.children.find { |c| c.is_a?(Xcodeproj::Project::Object::PBXGroup) && c.path == component }
88+
# Look for existing group using display_name, which is how Xcode shows group names
89+
# (display_name returns name || path, matching what Xcode displays)
90+
child = current_group.children.find { |c|
91+
c.is_a?(Xcodeproj::Project::Object::PBXGroup) && c.display_name == component
92+
}
9393

9494
if child
9595
current_group = child

0 commit comments

Comments
 (0)