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

Merge pull request #34680 from Calinou/editor-export-nonzero-exit-code-error

Exit the editor export process with a non-zero exit code on error
This commit is contained in:
Rémi Verschelde
2019-12-30 18:07:36 +01:00
committed by GitHub

View File

@@ -171,6 +171,7 @@
#include "editor/settings_config_dialog.h" #include "editor/settings_config_dialog.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
EditorNode *EditorNode::singleton = NULL; EditorNode *EditorNode::singleton = NULL;
@@ -573,11 +574,13 @@ void EditorNode::_fs_changed() {
if (preset.is_null()) { if (preset.is_null()) {
String errstr = "Unknown export preset: " + export_defer.preset; String errstr = "Unknown export preset: " + export_defer.preset;
ERR_PRINTS(errstr); ERR_PRINTS(errstr);
OS::get_singleton()->set_exit_code(EXIT_FAILURE);
} else { } else {
Ref<EditorExportPlatform> platform = preset->get_platform(); Ref<EditorExportPlatform> platform = preset->get_platform();
if (platform.is_null()) { if (platform.is_null()) {
String errstr = "Preset \"" + export_defer.preset + "\" doesn't have a platform."; String errstr = "Preset \"" + export_defer.preset + "\" doesn't have a platform.";
ERR_PRINTS(errstr); ERR_PRINTS(errstr);
OS::get_singleton()->set_exit_code(EXIT_FAILURE);
} else { } else {
// ensures export_project does not loop infinitely, because notifications may // ensures export_project does not loop infinitely, because notifications may
// come during the export // come during the export
@@ -594,6 +597,7 @@ void EditorNode::_fs_changed() {
} }
if (err != OK) { if (err != OK) {
ERR_PRINTS(vformat(TTR("Project export failed with error code %d."), (int)err)); ERR_PRINTS(vformat(TTR("Project export failed with error code %d."), (int)err));
OS::get_singleton()->set_exit_code(EXIT_FAILURE);
} }
} }
} }