From 402c22ab3431f99bee55192617c852a6edc5c99b Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Sun, 29 May 2016 22:07:52 +0200 Subject: [PATCH] Initial commit --- lib/pbxProject.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/pbxProject.js b/lib/pbxProject.js index 9a2f5ed..cc787f4 100644 --- a/lib/pbxProject.js +++ b/lib/pbxProject.js @@ -230,7 +230,7 @@ pbxProject.prototype.addResourceFile = function(path, opt, group) { file = this.addPluginFile(path, opt); if (!file) return false; } else { - file = new pbxFile(path, opt); + file = new pbxFile(path, opt); if (this.hasFile(file.path)) return false; } @@ -241,10 +241,10 @@ pbxProject.prototype.addResourceFile = function(path, opt, group) { correctForResourcesPath(file, this); file.fileRef = this.generateUuid(); } - + this.addToPbxBuildFileSection(file); // PBXBuildFile this.addToPbxResourcesBuildPhase(file); // PBXResourcesBuildPhase - + if (!opt.plugin) { this.addToPbxFileReferenceSection(file); // PBXFileReference if (group) { @@ -253,9 +253,9 @@ pbxProject.prototype.addResourceFile = function(path, opt, group) { else { this.addToResourcesPbxGroup(file); // PBXGroup } - + } - + return file; } @@ -279,7 +279,7 @@ pbxProject.prototype.removeResourceFile = function(path, opt, group) { } else { this.removeFromResourcesPbxGroup(file); // PBXGroup - } + } this.removeFromPbxResourcesBuildPhase(file); // PBXResourcesBuildPhase return file; @@ -1167,9 +1167,12 @@ pbxProject.prototype.addToLibrarySearchPaths = function(file) { if (unquote(buildSettings['PRODUCT_NAME']) != this.productName) continue; - if (!buildSettings['LIBRARY_SEARCH_PATHS'] - || buildSettings['LIBRARY_SEARCH_PATHS'] === INHERITED) { - buildSettings['LIBRARY_SEARCH_PATHS'] = [INHERITED]; + if (!buildSettings['LIBRARY_SEARCH_PATHS']) { + buildSettings['LIBRARY_SEARCH_PATHS'] = [INHERITED]; + } + + if (typeof buildSettings['LIBRARY_SEARCH_PATHS'] === 'string') { + buildSettings['LIBRARY_SEARCH_PATHS'] = [buildSettings['LIBRARY_SEARCH_PATHS']]; } if (typeof file === 'string') {