Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/pbxFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function pbxFile(filepath, opt) {
this.dirname = $path.dirname(filepath);
}

this.basename = $path.basename(filepath);
this.basename = opt.basename || $path.basename(filepath);
this.path = correctPath(this, filepath);
this.group = correctGroup(this);

Expand Down
9 changes: 8 additions & 1 deletion lib/pbxProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ pbxProject.prototype.addPbxGroup = function (filePathsArray, name, path, sourceT
if (opt.isMain) {
let mainGroup = this.findMainPbxGroup();
if (mainGroup) {
var file = new pbxFile($path.relative(this.filepath, path));
var file = new pbxFile($path.relative(this.filepath, path), {basename: name});
file.fileRef = pbxGroupUuid;
mainGroup.children.push(pbxGroupChild(file));
}
Expand All @@ -403,6 +403,13 @@ pbxProject.prototype.removePbxGroup = function(name, path) {
this.removeFromPbxSourcesBuildPhase(file);
}

var mainGroupChildren = this.findMainPbxGroup().children, i;
for(i in mainGroupChildren) {
if (mainGroupChildren[i].comment == name) {
mainGroupChildren.splice(i, 1);
}
}

//copied from https://github.com/alunny/node-xcode/blob/master/lib/pbxProject.js#L527
var section = this.hash.project.objects['PBXGroup'],
key, itemKey;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"author": "Andrew Lunny <alunny@gmail.com>",
"name": "xcode",
"description": "parser for xcodeproj/project.pbxproj files",
"version": "0.8.0",
"main":"index.js",
"version": "1.5.0-NativeScript",
"repository": {
"url": "https://github.com/alunny/node-xcode.git"
},
Expand Down