Skip to content

Commit

Permalink
Create the temporary PCK export directory if it doesn't exist
Browse files Browse the repository at this point in the history
This closes #45560.
  • Loading branch information
Calinou committed Jan 29, 2021
1 parent 46de553 commit 42ef79b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions editor/editor_export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "'.");
Expand Down

0 comments on commit 42ef79b

Please sign in to comment.