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

Commit 5a31a31

Browse files
committed
delete bundle file if it already exists
1 parent d013935 commit 5a31a31

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)