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

Commit bcd0561

Browse files
committed
Merge pull request #89 from Microsoft/asset-update-bug
Delete bundle file if it already exists
2 parents d013935 + 5a31a31 commit bcd0561

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

CodePushPackage.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,14 @@ + (void)downloadPackage:(NSDictionary *)updatePackage
302302
return;
303303
}
304304
} else {
305+
if ([[NSFileManager defaultManager] fileExistsAtPath:bundleFilePath]) {
306+
[[NSFileManager defaultManager] removeItemAtPath:bundleFilePath error:&error];
307+
if (error) {
308+
failCallback(error);
309+
return;
310+
}
311+
}
312+
305313
[[NSFileManager defaultManager] moveItemAtPath:downloadFilePath
306314
toPath:bundleFilePath
307315
error:&error];

0 commit comments

Comments
 (0)