]> gitweb.factorcode.org Git - factor.git/commitdiff
vm: setting current directory when launching Factor.app
authorJohn Benediktsson <mrjbq7@gmail.com>
Sun, 9 Jan 2022 04:29:00 +0000 (20:29 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Sun, 9 Jan 2022 04:29:00 +0000 (20:29 -0800)
vm/os-macosx.mm

index 6583ce8720158c9e0e1024df1503ba4c13ee4bc6..4f1944a90c9f0dbae89482fcdff122bac931e854 100644 (file)
@@ -39,6 +39,9 @@ const char* default_image_path(void) {
   if ([path hasSuffix:@".app"] || [path hasSuffix:@".app/"]) {
     NSFileManager* mgr = [NSFileManager defaultManager];
 
+    NSString* root = [path stringByDeletingLastPathComponent];
+    [mgr changeCurrentDirectoryPath: root];
+
     NSString* imageInBundle =
         [[path stringByAppendingPathComponent:@"Contents/Resources"]
             stringByAppendingPathComponent:image];