Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix remove files #355

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix tests
  • Loading branch information
kronenthaler committed Jun 26, 2024
commit 093dc9088bfd251d422165708f2ab2cc4b740a38
7 changes: 2 additions & 5 deletions pbxproj/pbxextensions/ProjectFiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,11 +355,8 @@ def remove_file_by_id(self, file_id, target_name=None):
target.remove_build_phase(build_phase)

# remove it iff it's removed from all targets or no build file reference it
if len([
True
for x in self.objects.get_objects_in_section('PBXBuildFile')
if hasattr(x, 'fileRef') == file_ref.get_id()
]) != 0:
if len([1 for x in self.objects.get_objects_in_section('PBXBuildFile') if
hasattr(x, 'fileRef') and x.fileRef == file_ref.get_id()]) != 0:
return True

# remove the file from any groups if there is no reference from any target
Expand Down