File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
CocoaPodUI.xcodeproj/project.xcworkspace/xcuserdata/Akki.xcuserdatad Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,14 @@ - (void) applicationDidFinishLaunching: (NSNotification*) notification
74
74
- (void )findGemLocation
75
75
{
76
76
NSString *location = [[NSUserDefaults standardUserDefaults ] valueForKey: kPodGemPathKey ];
77
+ if ([location length ] > 0 ) {
78
+ if (![[NSFileManager defaultManager ] fileExistsAtPath: location]) {
79
+ // NSLog(@"False Location! ~ \"%@\"", location);
80
+ [[NSUserDefaults standardUserDefaults ] removeObjectForKey: kPodGemPathKey ];
81
+ [[NSUserDefaults standardUserDefaults ] synchronize ];
82
+ location = nil ;
83
+ }
84
+ }
77
85
// NSLog(@"Saved Location: %@", location);
78
86
if ([location length ] == 0 ) {
79
87
NSTask *sTask = [[NSTask alloc ] init ];
@@ -84,7 +92,7 @@ - (void)findGemLocation
84
92
NSFileHandle *output = [pipeOut fileHandleForReading ];
85
93
[sTask launch ];
86
94
NSData *data = [output readDataToEndOfFile ];
87
- NSString *path = [[NSString alloc ] initWithData: data encoding: NSUTF8StringEncoding];
95
+ NSString *path = [[[ NSString alloc ] initWithData: data encoding: NSUTF8StringEncoding] stringByTrimmingCharactersInSet: [ NSCharacterSet whitespaceAndNewlineCharacterSet ] ];
88
96
if ([[NSFileManager defaultManager ] fileExistsAtPath: path]) {
89
97
[[NSUserDefaults standardUserDefaults ] setValue: path forKeyPath: kPodGemPathKey ];
90
98
[[NSUserDefaults standardUserDefaults ] synchronize ];
You can’t perform that action at this time.
0 commit comments