From ae37f1a71f0672e042090ca073aded96b96c731d Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Mon, 13 Apr 2026 19:16:42 -0400 Subject: [PATCH] For Top Speed always try to get a valid download link. --- .install/Top Speed.sh | 21 +++++++++++++++++++-- README.md | 2 ++ linux-game-manager.sh | 1 + 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.install/Top Speed.sh b/.install/Top Speed.sh index 2209d56..c79fc5b 100644 --- a/.install/Top Speed.sh +++ b/.install/Top Speed.sh @@ -1,7 +1,24 @@ #!/usr/bin/env bash # shellcheck disable=SC2154 # set by linux-game-manager.sh check_architecture x86_64 -download "https://github.com/diamondStar35/top_speed/releases/download/release-build/TopSpeed-linux-x64-Release-v-2026.4.13.1.zip" + +releaseMetadataFile="TopSpeed-release-build.json" +releaseMetadataPath="${cache}/${releaseMetadataFile}" +releaseMetadataUrl="https://api.github.com/repos/diamondStar35/top_speed/releases/tags/release-build" +assetPattern='^TopSpeed-linux-x64-Release-v-.*\.zip$' + +rm -f "${releaseMetadataPath}" +download_named "${releaseMetadataFile}" "${releaseMetadataUrl}" + +assetName="$(jq -r --arg assetPattern "${assetPattern}" '.assets[] | select(.name | test($assetPattern)) | .name' "${releaseMetadataPath}" | head -n 1)" +assetUrl="$(jq -r --arg assetPattern "${assetPattern}" '.assets[] | select(.name | test($assetPattern)) | .browser_download_url' "${releaseMetadataPath}" | head -n 1)" + +if [[ -z "${assetName}" ]] || [[ -z "${assetUrl}" ]] || [[ "${assetName}" == "null" ]] || [[ "${assetUrl}" == "null" ]]; then + ui_msgbox "Linux Game Manager" "Linux Game Manager" "Unable to find the latest Top Speed Linux download in the GitHub release metadata." + exit 1 +fi + +download_named "${assetName}" "${assetUrl}" mkdir -p "${installPath}/TopSpeed" -unzip -o -d "${installPath}/TopSpeed" "${cache}/TopSpeed-linux-x64-Release-v-2026.4.13.1.zip" +unzip -o -d "${installPath}/TopSpeed" "${cache}/${assetName}" chmod +x "${installPath}/TopSpeed/TopSpeed" diff --git a/README.md b/README.md index 3f43821..7c65fbc 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ Installer and launcher for accessible to the blind games that run natively in Li As the project grows, more dependencies will most likely be added. When LGM is launched, it will check to make sure it has the required dependencies for it to do the work of downloading and extracting the game. Note that because every distro has a different package manager, dependencies for games themselves will not be resolved. Please consult the game's documentation to find out what is needed for the game to run. +Current base dependencies checked on launch: `7z`, `curl`, `dialog`, `jq`, `yad`, and `unzip`. + ## Disabling game entries To disable a game entry without deleting its script, set the first line of the script to start with `#//`. diff --git a/linux-game-manager.sh b/linux-game-manager.sh index a6ff5a9..4c0c76c 100755 --- a/linux-game-manager.sh +++ b/linux-game-manager.sh @@ -946,6 +946,7 @@ requiredPackages=( "7z" "curl" "dialog" + "jq" "yad" "unzip" )