Always call stringByStandardizingPath on the resource path

stringByStandardizingPath has an interesting quirk that causes it to
remove `/private` from the path if the result still indicates an 
existing file or directory
This commit is contained in:
Corey Johnson
2013-03-01 09:33:57 -08:00
committed by probablycorey
parent 31c1a202fd
commit 82bce082ef

View File

@@ -35,7 +35,6 @@
_resourcePath = [atomApplication.arguments objectForKey:@"resource-path"];
if (!alwaysUseBundleResourcePath && !_resourcePath) {
NSString *defaultRepositoryPath = @"~/github/atom";
defaultRepositoryPath = [defaultRepositoryPath stringByStandardizingPath];
if ([defaultRepositoryPath characterAtIndex:0] == '/') {
BOOL isDir = false;
BOOL exists = [[NSFileManager defaultManager] fileExistsAtPath:defaultRepositoryPath isDirectory:&isDir];
@@ -47,6 +46,7 @@
if (alwaysUseBundleResourcePath || !_resourcePath) {
_resourcePath = [[NSBundle mainBundle] resourcePath];
}
_resourcePath = [_resourcePath stringByStandardizingPath];
[_resourcePath retain];
if (!background) {