File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ var path = require('path'),
6
6
DYLIB_EXTENSION = / [ . ] d y l i b $ / , DYLIB = '"compiled.mach-o.dylib"' ,
7
7
FRAMEWORK_EXTENSION = / [ . ] f r a m e w o r k / , FRAMEWORK = 'wrapper.framework' ,
8
8
ARCHIVE_EXTENSION = / [ . ] a $ / , ARCHIVE = 'archive.ar' ,
9
+ PNG_EXTENSION = / [ . ] p n g / , PNG_IMAGE = "image.png" ,
9
10
DEFAULT_SOURCE_TREE = '"<group>"' ,
10
11
DEFAULT_FILE_ENCODING = 4 ;
11
12
@@ -30,13 +31,16 @@ function detectLastType(path) {
30
31
31
32
if ( ARCHIVE_EXTENSION . test ( path ) )
32
33
return ARCHIVE ;
33
-
34
+
35
+ if ( PNG_EXTENSION . test ( path ) )
36
+ return PNG_IMAGE ;
37
+
34
38
// dunno
35
39
return 'unknown' ;
36
40
}
37
41
38
42
function fileEncoding ( file ) {
39
- if ( file . lastType != BUNDLE && ! file . customFramework ) {
43
+ if ( file . lastType != BUNDLE && file . lastType !== PNG_IMAGE && ! file . customFramework ) {
40
44
return DEFAULT_FILE_ENCODING ;
41
45
}
42
46
}
Original file line number Diff line number Diff line change @@ -709,9 +709,18 @@ function pbxFileReferenceObj(file) {
709
709
710
710
obj . isa = 'PBXFileReference' ;
711
711
obj . lastKnownFileType = file . lastType ;
712
+ obj . name = file . basename ;
713
+ obj . path = file . path ;
712
714
713
- obj . name = "\"" + file . basename + "\"" ;
714
- obj . path = "\"" + file . path + "\"" ;
715
+ if ( obj . name . indexOf ( "\"" ) !== - 1 ) {
716
+ obj . name = obj . name . replace ( / \" / g, "\\\"" ) ;
717
+ obj . path = obj . path . replace ( / \" / g, "\\\"" ) ;
718
+ }
719
+
720
+ if ( ! file . basename . match ( / ^ [ a - z A - Z 0 - 9 _ \. \$ ] + \. [ a - z A - Z ] + $ / ) ) {
721
+ obj . name = "\"" + obj . name + "\"" ;
722
+ obj . path = "\"" + obj . path + "\"" ;
723
+ }
715
724
716
725
obj . sourceTree = file . sourceTree ;
717
726
You can’t perform that action at this time.
0 commit comments