From a8a1084c63ffba5a5cd1183ba8051add6a72d15b Mon Sep 17 00:00:00 2001 From: yannick-was-taken Date: Thu, 6 Apr 2023 23:06:16 +0200 Subject: [PATCH] check.sh: find Godot 4 executable when available as `godot` --- check.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/check.sh b/check.sh index fb9c859cc..54e2ab490 100755 --- a/check.sh +++ b/check.sh @@ -76,6 +76,18 @@ function findGodot() { echo "Found 'godot4.bat' script" godotBin="godot4.bat" + # This should come last: only use this as a last resort as usually `godot` + # refers to a Godot 3.x installation. + elif command -v godot &>/dev/null; then + # Check if `godot` actually is Godot 4.x + if godot --version | grep -qE "^4\\."; then + echo "Found 'godot' executable with version $(godot --version)" + godotBin="godot" + else + echo "Found 'godot' executable, but it has the incompatible version $(godot --version)" + exit 2 + fi + # Error case else echo "Godot executable not found" @@ -99,7 +111,7 @@ for arg in "${args[@]}"; do ;; itest) findGodot - + cmds+=("cargo $toolchain build -p itest $extraArgs") cmds+=("$godotBin --path itest/godot --headless") ;;