protondb.sh : now checks if latest proton-ge is already installed

This commit is contained in:
saundersp 2025-01-19 22:27:26 +01:00
parent 9dc6756eff
commit 8c512d1ba8

View File

@ -7,6 +7,9 @@ rm -rf /tmp/proton-ge-custom
mkdir /tmp/proton-ge-custom mkdir /tmp/proton-ge-custom
cd /tmp/proton-ge-custom cd /tmp/proton-ge-custom
echo 'Creating Steam directory if it does not exist...'
mkdir -p ~/.steam/root/compatibilitytools.d
echo 'Getting ProtonGE metadata' echo 'Getting ProtonGE metadata'
METADATA=$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep browser_download_url | cut -d\" -f4) METADATA=$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest | grep browser_download_url | cut -d\" -f4)
test -n "$METADATA" test -n "$METADATA"
@ -15,6 +18,8 @@ test -n "$METADATA"
echo 'Fetching tarball URL...' echo 'Fetching tarball URL...'
TARBALL_URL=$(echo "$METADATA" | grep .tar.gz) TARBALL_URL=$(echo "$METADATA" | grep .tar.gz)
TARBALL_NAME=$(basename "$TARBALL_URL") TARBALL_NAME=$(basename "$TARBALL_URL")
VERSION_NAME=$(echo "$TARBALL_NAME" | sed 's/.tar.gz//')
test -d ~/.steam/root/compatibilitytools.d/"$VERSION_NAME" && echo "Version $VERSION_NAME already present, aborting" && exit 0
echo "Downloading tarball: $TARBALL_NAME..." echo "Downloading tarball: $TARBALL_NAME..."
curl -# -L "$TARBALL_URL" -o "$TARBALL_NAME" --no-progress-meter curl -# -L "$TARBALL_URL" -o "$TARBALL_NAME" --no-progress-meter
@ -28,9 +33,6 @@ echo "Verifying tarball $TARBALL_NAME with checksum $CHECKSUM_NAME..."
sha512sum -c "$CHECKSUM_NAME" sha512sum -c "$CHECKSUM_NAME"
# If result is ok, continue # If result is ok, continue
echo 'Creating Steam directory if it does not exist...'
mkdir -p ~/.steam/root/compatibilitytools.d
echo "Extracting $TARBALL_NAME to Steam directory..." echo "Extracting $TARBALL_NAME to Steam directory..."
tar -xf "$TARBALL_NAME" -C ~/.steam/root/compatibilitytools.d/ tar -xf "$TARBALL_NAME" -C ~/.steam/root/compatibilitytools.d/
echo 'All done :)' echo 'All done :)'