summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRyan Roden-Corrent <ryan@rcorre.net>2022-03-10 07:33:54 -0500
committerRyan Roden-Corrent <ryan@rcorre.net>2022-03-10 07:35:30 -0500
commit66a278f585674ae4874ad52f1ffe9a90d5631b65 (patch)
tree713df09aa8f5066995e11ebbc9a8b3619ca7ba6f /editor
parent90faf04f293fcdf636f641bfe3d88c5857695d9b (diff)
Create parent directories on export.
Fixes #42231. This works for both the UI and the --export CLI flag.
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_export.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index 1afd59e99c..d081ee05a0 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -1831,10 +1831,6 @@ List<String> EditorExportPlatformPC::get_binary_extensions(const Ref<EditorExpor
Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) {
ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags);
- if (!DirAccess::exists(p_path.get_base_dir())) {
- return ERR_FILE_BAD_PATH;
- }
-
String custom_debug = p_preset->get("custom_template/debug");
String custom_release = p_preset->get("custom_template/release");
@@ -1863,9 +1859,9 @@ Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset> &p_pr
return ERR_FILE_NOT_FOUND;
}
- DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
+ DirAccessRef da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
+ da->make_dir_recursive(p_path.get_base_dir());
Error err = da->copy(template_path, p_path, get_chmod_flags());
- memdelete(da);
if (err == OK) {
String pck_path;
@@ -1901,7 +1897,6 @@ Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset> &p_pr
err = sign_shared_object(p_preset, p_debug, p_path.get_base_dir().plus_file(so_files[i].path.get_file()));
}
}
- memdelete(da);
}
}