Exit the editor export process with a non-zero exit code on error
This closes #34672.
This commit is contained in:
parent
12482bf884
commit
79494992e4
@ -133,6 +133,7 @@
|
|||||||
#include "editor/script_editor_debugger.h"
|
#include "editor/script_editor_debugger.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
EditorNode *EditorNode::singleton = NULL;
|
EditorNode *EditorNode::singleton = NULL;
|
||||||
|
|
||||||
@ -535,11 +536,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
|
||||||
@ -556,6 +559,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user