Skip to content

Commit 46f89b5

Browse files
committed
pbxFile: Rewritten detectType() method, using updated dictionaries.
1 parent fc56521 commit 46f89b5

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

lib/pbxFile.js

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -70,27 +70,20 @@ var FILETYPE_BY_EXTENSION = {
7070
};
7171

7272

73-
function detectLastType(path) {
74-
if (M_EXTENSION.test(path))
75-
return SOURCE_FILE;
73+
function detectType(filePath) {
74+
var extension = path.extname(filePath),
75+
type = FILETYPE_BY_EXTENSION[extension];
7676

77-
if (H_EXTENSION.test(path))
78-
return HEADER_FILE;
77+
if (!type) {
78+
return DEFAULT_FILETYPE;
79+
}
7980

80-
if (BUNDLE_EXTENSION.test(path))
81-
return BUNDLE;
81+
return type;
82+
}
8283

83-
if (XIB_EXTENSION.test(path))
84-
return XIB_FILE;
8584

86-
if (FRAMEWORK_EXTENSION.test(path))
87-
return FRAMEWORK;
8885

89-
if (DYLIB_EXTENSION.test(path))
90-
return DYLIB;
9186

92-
if (ARCHIVE_EXTENSION.test(path))
93-
return ARCHIVE;
9487

9588
// dunno
9689
return 'unknown';

0 commit comments

Comments
 (0)