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.cpp33
1 files changed, 14 insertions, 19 deletions
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index c9ac62a74d..7456cc902a 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -274,8 +274,6 @@ void EditorExportPlatform::gen_debug_flags(Vector<String> &r_flags, int p_flags)
}
Error EditorExportPlatform::_save_pack_file(void *p_userdata, const String &p_path, const Vector<uint8_t> &p_data, int p_file, int p_total) {
- if (p_path.ends_with(".so") || p_path.ends_with(".dylib") || p_path.ends_with(".dll"))
- return OK;
PackData *pd = (PackData *)p_userdata;
@@ -337,7 +335,7 @@ Error EditorExportPlatform::_save_zip_file(void *p_userdata, const String &p_pat
String EditorExportPlatform::find_export_template(String template_file_name, String *err) const {
- String current_version = itos(VERSION_MAJOR) + "." + itos(VERSION_MINOR) + "-" + VERSION_STATUS + VERSION_MODULE_CONFIG;
+ String current_version = VERSION_FULL_CONFIG;
String template_path = EditorSettings::get_singleton()->get_templates_dir().plus_file(current_version).plus_file(template_file_name);
if (FileAccess::exists(template_path)) {
@@ -1354,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) {