From 6dce9958fde05e20964bd344a7d67f49fc591ebb Mon Sep 17 00:00:00 2001 From: stormdragon2976 Date: Tue, 6 Dec 2022 10:17:27 -0500 Subject: [PATCH] Dependency checking can now handle python libraries. --- linux-game-manager.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/linux-game-manager.sh b/linux-game-manager.sh index dd8da8a..3aace38 100755 --- a/linux-game-manager.sh +++ b/linux-game-manager.sh @@ -81,7 +81,11 @@ check_architecture() { check_dependencies() { local dependencies for i in "${@}"; do - if ! command -v "$i" > /dev/null 2>&1 ; then + if [[ "$i" =~ ^python ]]; then + if ! python3 -c "import ${i#*:}" &> /dev/null ; then + dependencies+=("${i%:*}") + fi + elif ! command -v "$i" > /dev/null 2>&1 ; then dependencies+=("$i") fi done @@ -592,11 +596,13 @@ case "${game}" in add_launcher "${installPath}/S.E.A./SEA" ;; "Slay the Text") + check_dependencies python-ansimarkup:ansimarkup git -C "${installPath}/" clone https://github.com/Difio3333/slaythetext.git | \ dialog --progressbox "Installing \"${game}\", please wait..." -1 -1 add_launcher "${installPath}/slaythetext/main.py" ;; "SoundRTS") + check_dependencies pip3 mkdir -p "${installPath}" git -C "${installPath}" clone "https://github.com/soundmud/soundrts.git" git -C "${installPath}/soundrts" checkout v1.3.5