Last active
December 7, 2021 01:45
-
-
Save neil-morrison44/167cf508d31a6cb9bc44e55668068143 to your computer and use it in GitHub Desktop.
Pulls down the latest unstable MiSTer PSX core & puts it in the right place
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
VERSIONS_JSON=$(curl "https://api.github.com/repos/MiSTer-unstable-nightlies/PlayStation_MiSTer/releases?tag=unstable-builds" \ | |
--insecure | jq '[.[0].assets[] | select(.name|endswith(".rbf")) | {name: .name, url: .browser_download_url} ]') | |
echo $VERSIONS_JSON | jq | |
echo "Could allow for selection, but instead I'll just download the latest one..." | |
LATEST_NAME=$(echo $VERSIONS_JSON | jq -r 'last.name') | |
LATEST_URL=$(echo $VERSIONS_JSON | jq -r 'last.url') | |
echo $LATEST_NAME | |
TMP_CORE_PATH="/tmp/${LATEST_NAME}" | |
DATE=$(echo $LATEST_NAME | grep -Eo '_[[:digit:]]{8}') | |
FINAL_CORE_PATH="/media/fat/_Console/PlayStation${DATE}.rbf" | |
echo $DATE | |
echo $TMP_CORE_PATH | |
echo $FINAL_CORE_PATH | |
echo $LATEST_URL | |
curl $LATEST_URL -L --insecure --output $TMP_CORE_PATH | |
rm -f /media/fat/_Console/PlayStation_* | |
mv $TMP_CORE_PATH $FINAL_CORE_PATH | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment