summaryrefslogtreecommitdiff
path: root/editor/editor_export.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_export.cpp')
-rw-r--r--editor/editor_export.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index da4bbf9b7a..7456cc902a 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -1352,27 +1352,24 @@ Error EditorExportPlatformPC::export_project(const Ref<EditorExportPreset> &p_pr
DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
Error err = da->copy(template_path, p_path, get_chmod_flags());
- memdelete(da);
-
- if (err != OK) {
- return err;
- }
-
- String pck_path = p_path.get_basename() + ".pck";
+ if (err == OK) {
+ String pck_path = p_path.get_basename() + ".pck";
- Vector<SharedObject> so_files;
+ Vector<SharedObject> so_files;
- err = save_pack(p_preset, pck_path, &so_files);
+ err = save_pack(p_preset, pck_path, &so_files);
- if (err != OK || so_files.empty())
- return err;
- //if shared object files, copy them
- da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
- for (int i = 0; i < so_files.size(); i++) {
- da->copy(so_files[i].path, p_path.get_base_dir().plus_file(so_files[i].path.get_file()));
+ if (err == OK && !so_files.empty()) {
+ //if shared object files, copy them
+ da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
+ for (int i = 0; i < so_files.size() && err == OK; i++) {
+ err = da->copy(so_files[i].path, p_path.get_base_dir().plus_file(so_files[i].path.get_file()));
+ }
+ }
}
+
memdelete(da);
- return OK;
+ return err;
}
void EditorExportPlatformPC::set_extension(const String &p_extension, const String &p_feature_key) {