New dependency checker for custom launchers provides a way to show what is required for launchers that are added to the git repository without .mp3 or .wad file included.

This commit is contained in:
Storm Dragon 2024-08-30 17:59:30 -04:00
parent 1313d0d689
commit a1c3302882
2 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,23 @@
check_dependencies() {
if [[ $# -lt 2 ]]; then
dialog --backtitle "Linux Game Manager" \
--msgbox "Invalid call to check_dependencies(). Please check your code." -1 -1 --stdout
exit 1
fi
local packagePath="$1" # Path where the launcher will attempt the package, e.g. ${gamePath/Addons/PACKAGENAME/something.pk3
local packageURL="$2" # URL where the package can be downloaded.
shift 2
if [[ -e "${packagePath}" ]]; then
return
fi
local message=(
"You are missing the \"${packagePath##/*}\" Package." $'\n'
"You can get it from \"${packageURL}\"" $'\n')
echo "${packageURL}" | DISPLAY="${DISPLAY:-:0}" xclip -selection clipboard && message+=("The URL has been copied to the clipboard." $'\n')
for i in "${@}" ; do
message+=("$i" $'\n')
done
dialog --backtitle "Linux Game Manager" \
--msgbox "${message[*]}" -1 -1 --stdout
exit 1
}

View File

@ -1,7 +1,8 @@
#!/usr/bin/env bash
# requires aoddoom1.wad
# https://www.moddb.com/mods/army-of-darkness-total-conversion/addons/army-of-darkness-doom-wad
# check for required wad.
source ${0%/*}/TobyCustom/.dependencies
check_dependencies "aoddoom1.wad" "https://www.moddb.com/mods/army-of-darkness-total-conversion/addons/army-of-darkness-doom-wad" "Place \"aoddoom1.wad\" in \"${gamePath}\"."
gamePath=~/.local/games/doom