This repository was archived by the owner on May 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
@interface CodePush : NSObject <RCTBridgeModule>
4
4
5
+ + (NSString *) getDocumentsDirectory ;
6
+
5
7
+ (NSURL *) getBundleUrl ;
6
8
7
9
@end
Original file line number Diff line number Diff line change @@ -15,6 +15,12 @@ @implementation CodePush
15
15
16
16
@synthesize bridge = _bridge;
17
17
18
+ + (NSString *)getDocumentsDirectory
19
+ {
20
+ NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains (NSDocumentDirectory,NSUserDomainMask, YES ) objectAtIndex: 0 ];
21
+ return documentsDirectory;
22
+ }
23
+
18
24
+ (NSString *) getBundlePath
19
25
{
20
26
NSString * bundleFolderPath = [self getPackageFolderPath ];
@@ -24,17 +30,17 @@ + (NSString *) getBundlePath
24
30
25
31
+ (NSString *) getPackageFolderPath
26
32
{
27
- NSString * home = NSHomeDirectory () ;
33
+ NSString * documentsDirectory = [ self getDocumentsDirectory ] ;
28
34
NSString * pathExtension = [[@" CodePush/" stringByAppendingString: (usingTestFolder ? @" test/" : @" " )] stringByAppendingString: @" currentPackage" ];
29
- NSString * packageFolder = [home stringByAppendingPathComponent: pathExtension];
35
+ NSString * packageFolder = [documentsDirectory stringByAppendingPathComponent: pathExtension];
30
36
return packageFolder;
31
37
}
32
38
33
39
+ (NSString *) getPreviousPackageFolderPath
34
40
{
35
- NSString * home = NSHomeDirectory () ;
41
+ NSString * documentsDirectory = [ self getDocumentsDirectory ] ;
36
42
NSString * pathExtension = [[@" CodePush/" stringByAppendingString: (usingTestFolder ? @" test/" : @" " )] stringByAppendingString: @" previous" ];
37
- NSString * packageFolder = [home stringByAppendingPathComponent: pathExtension];
43
+ NSString * packageFolder = [documentsDirectory stringByAppendingPathComponent: pathExtension];
38
44
return packageFolder;
39
45
}
40
46
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ @implementation CodePushPackage
6
6
7
7
+ (NSString *)getCodePushPath
8
8
{
9
- return [NSHomeDirectory () stringByAppendingPathComponent: @" CodePush" ];
9
+ return [[CodePush getDocumentsDirectory ] stringByAppendingPathComponent: @" CodePush" ];
10
10
}
11
11
12
12
+ (NSString *)getStatusFilePath
You can’t perform that action at this time.
0 commit comments