Skip to content

Commit a8a1084

Browse files
check.sh: find Godot 4 executable when available as godot
1 parent 04c2323 commit a8a1084

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

check.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,18 @@ function findGodot() {
7676
echo "Found 'godot4.bat' script"
7777
godotBin="godot4.bat"
7878

79+
# This should come last: only use this as a last resort as usually `godot`
80+
# refers to a Godot 3.x installation.
81+
elif command -v godot &>/dev/null; then
82+
# Check if `godot` actually is Godot 4.x
83+
if godot --version | grep -qE "^4\\."; then
84+
echo "Found 'godot' executable with version $(godot --version)"
85+
godotBin="godot"
86+
else
87+
echo "Found 'godot' executable, but it has the incompatible version $(godot --version)"
88+
exit 2
89+
fi
90+
7991
# Error case
8092
else
8193
echo "Godot executable not found"
@@ -99,7 +111,7 @@ for arg in "${args[@]}"; do
99111
;;
100112
itest)
101113
findGodot
102-
114+
103115
cmds+=("cargo $toolchain build -p itest $extraArgs")
104116
cmds+=("$godotBin --path itest/godot --headless")
105117
;;

0 commit comments

Comments
 (0)