diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-01-13 21:17:20 +0200 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-01-13 21:29:22 +0200 |
commit | fff3c38af92382d138426c2772257d8620071624 (patch) | |
tree | 111dd6490af1e3ea3d1abef61266ff58c627bee1 /editor | |
parent | d13c3c92965980aacbf94007d94a56aa92ebbb4e (diff) |
[macOS] Fix self-contained mode, by looking for `._sc_` and writing data to the bundle directory instead of executable directory.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_paths.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/editor/editor_paths.cpp b/editor/editor_paths.cpp index a4481cd1eb..d4e40db406 100644 --- a/editor/editor_paths.cpp +++ b/editor/editor_paths.cpp @@ -91,6 +91,11 @@ EditorPaths::EditorPaths() { // Self-contained mode if a `._sc_` or `_sc_` file is present in executable dir. String exe_path = OS::get_singleton()->get_executable_path().get_base_dir(); + + // On macOS, look outside .app bundle, since .app bundle is read-only. + if (OS::get_singleton()->has_feature("macos") && exe_path.ends_with("MacOS") && exe_path.plus_file("..").simplify_path().ends_with("Contents")) { + exe_path = exe_path.plus_file("../../..").simplify_path(); + } { DirAccessRef d = DirAccess::create_for_path(exe_path); |