summaryrefslogtreecommitdiff
path: root/editor/editor_export.cpp
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-01-29 22:07:00 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-01-30 00:51:56 +0100
commit42ef79b8263654e39dd94fd63ba43ae99709c750 (patch)
tree9c43ee2c6f0a85c5a7b2d5d0da64d0e5a9d53e2f /editor/editor_export.cpp
parent46de553473b4bea49176fb4316176a5662931160 (diff)
Create the temporary PCK export directory if it doesn't exist
This closes #45560.
Diffstat (limited to 'editor/editor_export.cpp')
-rw-r--r--editor/editor_export.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index dd3e81c8c0..24256b843e 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -1028,6 +1028,10 @@ Error EditorExportPlatform::_add_shared_object(void *p_userdata, const SharedObj
Error EditorExportPlatform::save_pack(const Ref<EditorExportPreset> &p_preset, const String &p_path, Vector<SharedObject> *p_so_files, bool p_embed, int64_t *r_embedded_start, int64_t *r_embedded_size) {
EditorProgress ep("savepack", TTR("Packing"), 102, true);
+ // Create the temporary export directory if it doesn't exist.
+ DirAccessRef da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
+ da->make_dir_recursive(EditorSettings::get_singleton()->get_cache_dir());
+
String tmppath = EditorSettings::get_singleton()->get_cache_dir().plus_file("packtmp");
FileAccess *ftmp = FileAccess::open(tmppath, FileAccess::WRITE);
ERR_FAIL_COND_V_MSG(!ftmp, ERR_CANT_CREATE, "Cannot create file '" + tmppath + "'.");