From 51cd88d1e0c0def0d8d49eb46390fc2e87b84412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sat, 3 Oct 2020 11:54:44 +0200 Subject: [PATCH] Check for Python 3 on Ubuntu and derivates. --- launch-game.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/launch-game.sh b/launch-game.sh index 86381e1..a67f92d 100755 --- a/launch-game.sh +++ b/launch-game.sh @@ -1,7 +1,6 @@ #!/bin/sh set -e -command -v python >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires python."; exit 1; } command -v mono >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires mono."; exit 1; } require_variables() { @@ -16,7 +15,15 @@ require_variables() { fi } -TEMPLATE_LAUNCHER=$(python -c "import os; print(os.path.realpath('$0'))") +if command -v python3 >/dev/null 2>&1; then + TEMPLATE_LAUNCHER=$(python3 -c "import os; print(os.path.realpath('$0'))") +elif command -v python >/dev/null 2>&1; then + TEMPLATE_LAUNCHER=$(python -c "import os; print(os.path.realpath('$0'))") +else + echo >&2 "The OpenRA mod template requires python." + exit 1 +fi + TEMPLATE_ROOT=$(dirname "${TEMPLATE_LAUNCHER}") MOD_SEARCH_PATHS="${TEMPLATE_ROOT}/mods,./mods"