Browse Source

Merge pull request #69367 from dogboydog/3.x_csharp_build_exit_code

3.x Exit editor with non-zero return code if --build-solutions fails
Rémi Verschelde 2 years ago
parent
commit
d4da275969
1 changed files with 2 additions and 0 deletions
  1. 2 0
      main/main.cpp

+ 2 - 0
main/main.cpp

@@ -2437,9 +2437,11 @@ bool Main::iteration() {
 		auto_build_solutions = false;
 		auto_build_solutions = false;
 		// Only relevant when running the editor.
 		// Only relevant when running the editor.
 		if (!editor) {
 		if (!editor) {
+			OS::get_singleton()->set_exit_code(EXIT_FAILURE);
 			ERR_FAIL_V_MSG(true, "Command line option --build-solutions was passed, but no project is being edited. Aborting.");
 			ERR_FAIL_V_MSG(true, "Command line option --build-solutions was passed, but no project is being edited. Aborting.");
 		}
 		}
 		if (!EditorNode::get_singleton()->call_build()) {
 		if (!EditorNode::get_singleton()->call_build()) {
+			OS::get_singleton()->set_exit_code(EXIT_FAILURE);
 			ERR_FAIL_V_MSG(true, "Command line option --build-solutions was passed, but the build callback failed. Aborting.");
 			ERR_FAIL_V_MSG(true, "Command line option --build-solutions was passed, but the build callback failed. Aborting.");
 		}
 		}
 	}
 	}