11var util = require ( 'util' ) ,
22 f = util . format ,
33 EventEmitter = require ( 'events' ) . EventEmitter ,
4- $ path = require ( 'path' ) ,
4+ path = require ( 'path' ) ,
55 uuid = require ( 'node-uuid' ) ,
66 fork = require ( 'child_process' ) . fork ,
77 pbxWriter = require ( './pbxWriter' ) ,
@@ -291,7 +291,7 @@ pbxProject.prototype.findMainPbxGroup = function () {
291291 var groups = this . hash . project . objects [ 'PBXGroup' ] ;
292292 var candidates = [ ] ;
293293 for ( var key in groups ) {
294- if ( groups [ key ] . path == undefined && groups [ key ] . name == undefined && groups [ key ] . isa ) {
294+ if ( ! groups [ key ] . path && ! groups [ key ] . name && groups [ key ] . isa ) {
295295 candidates . push ( groups [ key ] ) ;
296296 }
297297 }
@@ -304,7 +304,7 @@ pbxProject.prototype.findMainPbxGroup = function () {
304304
305305pbxProject . prototype . addPbxGroup = function ( filePathsArray , name , path , sourceTree , opt ) {
306306 var groups = this . hash . project . objects [ 'PBXGroup' ] ,
307- pbxGroupUuid = opt . uuid ? opt . uuid : this . generateUuid ( ) ,
307+ pbxGroupUuid = opt . uuid || this . generateUuid ( ) ,
308308 commentKey = f ( "%s_comment" , pbxGroupUuid ) ,
309309 pbxGroup = {
310310 isa : 'PBXGroup' ,
@@ -340,7 +340,7 @@ pbxProject.prototype.addPbxGroup = function (filePathsArray, name, path, sourceT
340340 var file = new pbxFile ( filePath ) ;
341341 if ( fs . lstatSync ( filePath ) . isDirectory ( ) ) {
342342 file . uuid = this . generateUuid ( ) ;
343- file . fileRef = this . generateUuid ( ) ;
343+ file . fileRef = file . uuid ;
344344 this . addToPbxFileReferenceSection ( file ) ; // PBXFileReference
345345 this . addToPbxBuildFileSection ( file ) ;
346346 pbxGroup . children . push ( pbxGroupChild ( file ) ) ;
0 commit comments