Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 038112e

Browse files
committed
add comment
1 parent 132bf00 commit 038112e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CodePush.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ + (NSURL *)bundleURLForResource:(NSString *)resourceName
8787
NSString *packageDate = [currentPackageMetadata objectForKey:BinaryBundleDateKey];
8888
NSString *packageAppVersion = [currentPackageMetadata objectForKey:@"appVersion"];
8989

90-
if ([[self modifiedDateStringOfFileAtUrl:binaryBundleURL] isEqualToString:packageDate] && ([CodePush isUsingTestConfiguration] ||[binaryAppVersion isEqualToString:packageAppVersion])) {
90+
if ([[self modifiedDateStringOfFileAtURL:binaryBundleURL] isEqualToString:packageDate] && ([CodePush isUsingTestConfiguration] ||[binaryAppVersion isEqualToString:packageAppVersion])) {
9191
// Return package file because it is newer than the app store binary's JS bundle
9292
NSURL *packageUrl = [[NSURL alloc] initFileURLWithPath:packageFile];
9393
NSLog(logMessageFormat, packageUrl);
@@ -397,7 +397,7 @@ - (void)savePendingUpdate:(NSString *)packageHash
397397
NSDictionary *mutableUpdatePackage = [updatePackage mutableCopy];
398398
NSURL *binaryBundleURL = [CodePush binaryBundleURL];
399399
if (binaryBundleURL != nil) {
400-
[mutableUpdatePackage setValue:[CodePush modifiedDateStringOfFileAtUrl:binaryBundleURL]
400+
[mutableUpdatePackage setValue:[CodePush modifiedDateStringOfFileAtURL:binaryBundleURL]
401401
forKey:BinaryBundleDateKey];
402402
}
403403

CodePushPackage.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ + (void)downloadPackage:(NSDictionary *)updatePackage
229229
NSMutableDictionary * mutableUpdatePackage = [updatePackage mutableCopy];
230230
if (isZip) {
231231
if ([[NSFileManager defaultManager] fileExistsAtPath:unzippedFolderPath]) {
232+
// This removes any unzipped download data that could have been left
233+
// uncleared due to a crash or error during the download process.
232234
[[NSFileManager defaultManager] removeItemAtPath:unzippedFolderPath
233235
error:&error];
234236
if (error) {

0 commit comments

Comments
 (0)