Skip to content

Commit 88d2049

Browse files
committed
fix: assets of main target removed by mistake
1 parent 836a9a8 commit 88d2049

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lib/pbxProject.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,17 @@ pbxProject.prototype.removeFromPbxBuildFileSection = function(file) {
508508
}
509509
}
510510

511+
pbxProject.prototype.removeFromPbxBuildFileSectionByFileRef = function(file) {
512+
var fileUuid;
513+
var pbxBuildFileSection = this.pbxBuildFileSection();
514+
515+
for (fileUuid in pbxBuildFileSection) {
516+
if (pbxBuildFileSection[fileUuid].fileRef == file.uuid) {
517+
this.removeFromPbxBuildFileSectionByUuid(fileUuid);
518+
}
519+
}
520+
}
521+
511522
pbxProject.prototype.removeFromPbxBuildFileSectionByUuid = function(itemUuid) {
512523
var buildSection = this.pbxBuildFileSection();
513524
removeItemAndCommentFromSectionByUuid(buildSection, itemUuid);
@@ -701,7 +712,7 @@ pbxProject.prototype.removePbxGroupByKey = function(groupKey, path) {
701712
file.uuid = file.fileRef;
702713
this.removePbxGroupByKey(children[i].value, $path.join(path, children[i].comment));
703714
this.removeFromPbxFileReferenceSectionByUuid(children[i].value);
704-
this.removeFromPbxBuildFileSection(file);
715+
this.removeFromPbxBuildFileSectionByFileRef(file);
705716
this.removeFromPbxSourcesBuildPhase(file);
706717
}
707718

0 commit comments

Comments
 (0)