Dependency checking can now handle python libraries.

This commit is contained in:
stormdragon2976 2022-12-06 10:17:27 -05:00
parent 34000858de
commit 6dce9958fd

View File

@ -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