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: support productRef when removing files #353

Merged
merged 1 commit into from
Jun 26, 2024

Conversation

OmarIthawi
Copy link
Contributor

fix the exception below:

  File "pbxproj/pbxextensions/ProjectFiles.py", line 332, in remove_file_by_id
    if build_file.fileRef == file_ref.get_id():
AttributeError: 'PBXBuildFile' object has no attribute 'fileRef'

Fixes #352

fix the exception below:

```
  File "pbxproj/pbxextensions/ProjectFiles.py", line 332, in remove_file_by_id
    if build_file.fileRef == file_ref.get_id():
AttributeError: 'PBXBuildFile' object has no attribute 'fileRef'
```

Fixes kronenthaler#352
@kronenthaler kronenthaler changed the base branch from master to fix-remove-files June 26, 2024 13:28
Comment on lines +342 to +346
if len([
True
for x in self.objects.get_objects_in_section('PBXBuildFile')
if hasattr(x, 'fileRef') == file_ref.get_id()
]) != 0:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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') && x.fileRef == file_ref.get_id()]) != 0:

@kronenthaler kronenthaler merged commit 78e45a5 into kronenthaler:fix-remove-files Jun 26, 2024
0 of 5 checks passed
@kronenthaler
Copy link
Owner

@OmarIthawi thanks for the contribution

@OmarIthawi
Copy link
Contributor Author

Thanks @kronenthaler a lot for the quick triage!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Exception is thrown when finding productRef instead of fileRef
2 participants