1
1
var util = require ( 'util' ) ,
2
2
f = util . format ,
3
3
EventEmitter = require ( 'events' ) . EventEmitter ,
4
- $ path = require ( 'path' ) ,
4
+ path = require ( 'path' ) ,
5
5
uuid = require ( 'node-uuid' ) ,
6
6
fork = require ( 'child_process' ) . fork ,
7
7
pbxWriter = require ( './pbxWriter' ) ,
@@ -291,7 +291,7 @@ pbxProject.prototype.findMainPbxGroup = function () {
291
291
var groups = this . hash . project . objects [ 'PBXGroup' ] ;
292
292
var candidates = [ ] ;
293
293
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 ) {
295
295
candidates . push ( groups [ key ] ) ;
296
296
}
297
297
}
@@ -304,7 +304,7 @@ pbxProject.prototype.findMainPbxGroup = function () {
304
304
305
305
pbxProject . prototype . addPbxGroup = function ( filePathsArray , name , path , sourceTree , opt ) {
306
306
var groups = this . hash . project . objects [ 'PBXGroup' ] ,
307
- pbxGroupUuid = opt . uuid ? opt . uuid : this . generateUuid ( ) ,
307
+ pbxGroupUuid = opt . uuid || this . generateUuid ( ) ,
308
308
commentKey = f ( "%s_comment" , pbxGroupUuid ) ,
309
309
pbxGroup = {
310
310
isa : 'PBXGroup' ,
@@ -340,7 +340,7 @@ pbxProject.prototype.addPbxGroup = function (filePathsArray, name, path, sourceT
340
340
var file = new pbxFile ( filePath ) ;
341
341
if ( fs . lstatSync ( filePath ) . isDirectory ( ) ) {
342
342
file . uuid = this . generateUuid ( ) ;
343
- file . fileRef = this . generateUuid ( ) ;
343
+ file . fileRef = file . uuid ;
344
344
this . addToPbxFileReferenceSection ( file ) ; // PBXFileReference
345
345
this . addToPbxBuildFileSection ( file ) ;
346
346
pbxGroup . children . push ( pbxGroupChild ( file ) ) ;
0 commit comments