use appsupport dir

This commit is contained in:
Geoffrey Goh
2015-12-08 18:33:59 -08:00
parent bffcba8b30
commit b059fd7679
3 changed files with 21 additions and 5 deletions

View File

@@ -14,7 +14,7 @@ NSString * const UnzippedFolderName = @"unzipped";
+ (NSString *)getCodePushPath
{
return [[CodePush getDocumentsDirectory] stringByAppendingPathComponent:@"CodePush"];
return [[CodePush getApplicationSupportDirectory] stringByAppendingPathComponent:@"CodePush"];
}
+ (NSString *)getDownloadFilePath
@@ -290,6 +290,22 @@ NSString * const UnzippedFolderName = @"unzipped";
}
if (relativeBundlePath) {
NSString *absoluteBundlePath = [newPackageFolderPath stringByAppendingPathComponent:relativeBundlePath];
NSDictionary *bundleFileAttributes = [[[NSFileManager defaultManager] attributesOfItemAtPath:absoluteBundlePath error:&error] mutableCopy];
if (error) {
failCallback(error);
return;
}
[bundleFileAttributes setValue:[NSDate date] forKey:NSFileModificationDate];
[[NSFileManager defaultManager] setAttributes:bundleFileAttributes
ofItemAtPath:absoluteBundlePath
error:&error];
if (error) {
failCallback(error);
return;
}
[mutableUpdatePackage setValue:relativeBundlePath forKey:RelativeBundlePathKey];
} else {
error = [[NSError alloc] initWithDomain:CodePushErrorDomain