diff --git a/lib/pbxFile.js b/lib/pbxFile.js index b226550..ed6a56d 100644 --- a/lib/pbxFile.js +++ b/lib/pbxFile.js @@ -166,13 +166,12 @@ function pbxFile(filepath, opt) { // for custom frameworks if (opt.customFramework == true) { this.customFramework = true; - this.dirname = path.dirname(filepath); + this.dirname = path.dirname(filepath).replace(/\\/g, '/'); } - this.path = defaultPath(this, filepath); + this.path = defaultPath(this, filepath).replace(/\\/g, '/'); this.fileEncoding = this.defaultEncoding = opt.defaultEncoding || defaultEncoding(self); - // When referencing products / build output files if (opt.explicitFileType) { this.explicitFileType = opt.explicitFileType; diff --git a/lib/pbxProject.js b/lib/pbxProject.js index 77b4530..da05245 100644 --- a/lib/pbxProject.js +++ b/lib/pbxProject.js @@ -304,7 +304,7 @@ pbxProject.prototype.removeFramework = function(fpath, opt) { this.removeFromPbxEmbedFrameworksBuildPhase(file); // PBXCopyFilesBuildPhase if (opt && opt.customFramework) { - this.removeFromFrameworkSearchPaths(path.dirname(fpath)); + this.removeFromFrameworkSearchPaths(file.dirname); } return file; diff --git a/test/dataModelDocument.js b/test/dataModelDocument.js index 00a1ac8..fa0b8a8 100644 --- a/test/dataModelDocument.js +++ b/test/dataModelDocument.js @@ -152,7 +152,8 @@ exports.dataModelDocument = { test.equal(xcVersionGroupEntry.children[0], newFile.models[0].fileRef); test.equal(xcVersionGroupEntry.currentVersion, newFile.currentModel.fileRef); test.equal(xcVersionGroupEntry.name, path.basename(singleDataModelFilePath)); - test.equal(xcVersionGroupEntry.path, singleDataModelFilePath); + // Need to validate against normalized path, since paths should contain forward slash on OSX + test.equal(xcVersionGroupEntry.path, singleDataModelFilePath.replace(/\\/g, '/')); test.equal(xcVersionGroupEntry.sourceTree, '""'); test.equal(xcVersionGroupEntry.versionGroupType, 'wrapper.xcdatamodel');