浏览代码

godot exit code improvement for --script --check-only, fixes #33895

this commit causes godot executable to return non-zero exit code
once invalid script is passed via --script during --check-only
Pawel Lampe 5 年之前
父节点
当前提交
9feb9aef42
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      main/main.cpp

+ 3 - 0
main/main.cpp

@@ -1517,6 +1517,9 @@ bool Main::start() {
 		ERR_FAIL_COND_V_MSG(script_res.is_null(), false, "Can't load script: " + script);
 
 		if (check_only) {
+			if (!script_res->is_valid()) {
+				OS::get_singleton()->set_exit_code(1);
+			}
 			return false;
 		}