forked from unknown-horizons/godot-port
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·30 lines (26 loc) · 879 Bytes
/
run.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
# Godot version or path.
GODOT="3.1"
# Look for the Godot binary.
if [ -f "$GODOT" ]; then
: # Do nothing. It's already a valid path.
elif [ -f "$HOME/.local/share/Godot/$GODOT/Godot" ]; then
GODOT="$HOME/.local/share/Godot/$GODOT/Godot"
elif [ -f "$HOME/.local/bin/Godot/$GODOT/Godot" ]; then
GODOT="$HOME/.local/bin/Godot/$GODOT/Godot"
elif [ -f "$HOME/Documents/Godot/$GODOT/Godot" ]; then
GODOT="$HOME/Documents/Godot/$GODOT/Godot"
# Godot snaps use the "binary-v1-v2" name form
elif [ -f "/snap/bin/godot-${GODOT%%.*}-${GODOT##*.}" ]; then
GODOT="/snap/bin/godot-${GODOT%%.*}-${GODOT##*.}"
else
echo "Error: Can't find the Godot editor. Can't run. "
exit 1
fi
# Is this a Godot project?
if [ ! -f "project.godot" ]; then
echo "Error: This isn't the directory of a Godot project. Can't run. "
exit 2
fi
# Run
$GODOT --path .