Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check.sh: find Godot 4 executable when available as godot #217

Merged
merged 1 commit into from
Apr 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -99,7 +111,7 @@ for arg in "${args[@]}"; do
;;
itest)
findGodot

cmds+=("cargo $toolchain build -p itest $extraArgs")
cmds+=("$godotBin --path itest/godot --headless")
;;
Expand Down