1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Improved error checking at EditorExportPlatformPC::export_project

This commit is contained in:
Marcelo Fernandez
2018-03-06 12:13:18 -03:00
parent 4f1b87265e
commit 0876502f72
3 changed files with 24 additions and 24 deletions

View File

@@ -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) {
String pck_path = p_path.get_basename() + ".pck";
if (err != OK) {
return err;
Vector<SharedObject> so_files;
err = save_pack(p_preset, pck_path, &so_files);
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()));
}
}
}
String pck_path = p_path.get_basename() + ".pck";
Vector<SharedObject> 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()));
}
memdelete(da);
return OK;
return err;
}
void EditorExportPlatformPC::set_extension(const String &p_extension, const String &p_feature_key) {