diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2019-12-29 16:11:58 +0100 |
---|---|---|
committer | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2019-12-30 14:34:06 +0100 |
commit | 79494992e4745cf95265737f36602973cdc907a5 (patch) | |
tree | 21fda7305feea47d6caa2e05450cd85e35e49072 /editor | |
parent | 12482bf8840ce2fa84d6eea7999628be426cba8d (diff) |
Exit the editor export process with a non-zero exit code on error
This closes #34672.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_node.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 1f7dfed06e..71be046990 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -133,6 +133,7 @@ #include "editor/script_editor_debugger.h" #include <stdio.h> +#include <stdlib.h> EditorNode *EditorNode::singleton = NULL; @@ -535,11 +536,13 @@ void EditorNode::_fs_changed() { if (preset.is_null()) { String errstr = "Unknown export preset: " + export_defer.preset; ERR_PRINTS(errstr); + OS::get_singleton()->set_exit_code(EXIT_FAILURE); } else { Ref<EditorExportPlatform> platform = preset->get_platform(); if (platform.is_null()) { String errstr = "Preset \"" + export_defer.preset + "\" doesn't have a platform."; ERR_PRINTS(errstr); + OS::get_singleton()->set_exit_code(EXIT_FAILURE); } else { // ensures export_project does not loop infinitely, because notifications may // come during the export @@ -556,6 +559,7 @@ void EditorNode::_fs_changed() { } if (err != OK) { ERR_PRINTS(vformat(TTR("Project export failed with error code %d."), (int)err)); + OS::get_singleton()->set_exit_code(EXIT_FAILURE); } } } |