mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-22 04:30:47 +00:00
Adds removing old data before downloading new one via XPC.
This commit is contained in:
1 parent
1e14f7d7b6
commit
67ebc6ff74
1 file changed
+6
@@ -76,6 +76,12 @@ static NSString * const kSUFetchFolderName = @"fetch.XXXXXXXX";
|
||||
NSURL *tempFolder = [NSURL fileURLWithPath:NSTemporaryDirectory()];
|
||||
NSString *tempFileTemplate = [[tempFolder URLByAppendingPathComponent:kSUFetchFolderName] path];
|
||||
NSString *tempFilePath = [tempFileTemplate stringByAppendingPathComponent:[_destination lastPathComponent]];
|
||||
|
||||
if ([[NSFileManager defaultManager] fileExistsAtPath:tempFilePath])
|
||||
{
|
||||
[[NSFileManager defaultManager] removeItemAtPath:tempFilePath error:nil];
|
||||
[[NSFileManager defaultManager] createDirectoryAtPath:tempFilePath withIntermediateDirectories:YES attributes:nil error:nil];
|
||||
}
|
||||
_connectionDestination = [tempFilePath copy];
|
||||
|
||||
NSData *requestData = [NSKeyedArchiver archivedDataWithRootObject:urlRequest];
|
||||
|
||||
Reference in new issue
Block a user