From 72e01ebb6296d322a5fa5d05215bdc531810e61d Mon Sep 17 00:00:00 2001 From: chenxy Date: Thu, 24 Oct 2013 09:54:31 +0800 Subject: [PATCH] fixed failure of removing framework sometimes --- lib/pbxProject.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/pbxProject.js b/lib/pbxProject.js index 620aa3b..8f21cbf 100644 --- a/lib/pbxProject.js +++ b/lib/pbxProject.js @@ -269,8 +269,15 @@ pbxProject.prototype.removeFromPbxFileReferenceSection = function (file) { var i; var refObj = pbxFileReferenceObj(file); for(i in this.pbxFileReferenceSection()) { - if(this.pbxFileReferenceSection()[i].name == refObj.name || - this.pbxFileReferenceSection()[i].path == refObj.path) { + var section = this.pbxFileReferenceSection()[i]; + if(section.name && section.name.indexOf('"') == -1) { + section.name = '"' + section.name + '"'; + } + if(section.path && section.path.indexOf('"') == -1) { + section.path = '"' + section.path + '"'; + } + if(section.name == refObj.name || + section.path == refObj.path) { file.fileRef = file.uuid = i; delete this.pbxFileReferenceSection()[i]; break;