Created
October 21, 2024 18:38
-
-
Save pohy/723e4f552dd8f6b80f7d8d0d9e7094f1 to your computer and use it in GitHub Desktop.
Run specific godot version from CLI
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
# Place into ~/.local/bin/godot, or wherever | |
# Also adjust GODOT_PATH to taste | |
VERSION=4.3 | |
REST_ARGS=() | |
while [ "$1" != "" ]; do | |
case $1 in | |
-v | --version) | |
shift | |
VERSION=$1 | |
;; | |
*) | |
REST_ARGS+=("$1") | |
;; | |
esac | |
shift | |
done | |
GODOT_PATH=/Applications/Godot_v$VERSION.app/Contents/MacOS/Godot | |
if [ -f $GODOT_PATH ]; then | |
$GODOT_PATH "${REST_ARGS[@]}" | |
else | |
echo "Godot v$VERSION not found at $GODOT_PATH" >&2 | |
AVAILBLE_VERSIONS=$(ls /Applications | grep Godot_v | sed 's/Godot_v//g' | sed 's/\.app//g' | sort -n) | |
echo "Available versions:\n$AVAILBLE_VERSIONS" >&2 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment