@@ -29,25 +29,27 @@ + (void)addFolderEntriesToManifest:(NSString*)folderPath
2929 }
3030
3131 for (NSString * fileName in folderFiles) {
32- if ([[self ignoredFilenames ] containsObject: fileName]) {
33- continue ;
34- }
35- NSString * fullFilePath = [folderPath stringByAppendingPathComponent: fileName];
36- NSString * relativePath = [pathPrefix stringByAppendingPathComponent: fileName];
37- BOOL isDir = NO ;
38- if ([[NSFileManager defaultManager ] fileExistsAtPath: fullFilePath
39- isDirectory: &isDir] && isDir) {
40- [self addFolderEntriesToManifest: fullFilePath
41- pathPrefix: relativePath
42- manifestEntries: manifestEntries
43- error: error];
44- if (*error) {
45- return ;
32+ @autoreleasepool {
33+ if ([[self ignoredFilenames ] containsObject: fileName]) {
34+ continue ;
35+ }
36+ NSString * fullFilePath = [folderPath stringByAppendingPathComponent: fileName];
37+ NSString * relativePath = [pathPrefix stringByAppendingPathComponent: fileName];
38+ BOOL isDir = NO ;
39+ if ([[NSFileManager defaultManager ] fileExistsAtPath: fullFilePath
40+ isDirectory: &isDir] && isDir) {
41+ [self addFolderEntriesToManifest: fullFilePath
42+ pathPrefix: relativePath
43+ manifestEntries: manifestEntries
44+ error: error];
45+ if (*error) {
46+ return ;
47+ }
48+ } else {
49+ NSData * fileContents = [NSData dataWithContentsOfFile: fullFilePath];
50+ NSString * fileContentsHash = [self computeHashForData: fileContents];
51+ [manifestEntries addObject: [[relativePath stringByAppendingString: @" :" ] stringByAppendingString: fileContentsHash]];
4652 }
47- } else {
48- NSData * fileContents = [NSData dataWithContentsOfFile: fullFilePath];
49- NSString * fileContentsHash = [self computeHashForData: fileContents];
50- [manifestEntries addObject: [[relativePath stringByAppendingString: @" :" ] stringByAppendingString: fileContentsHash]];
5153 }
5254 }
5355}
0 commit comments