Skip to content

Instantly share code, notes, and snippets.

@rkben
Created December 25, 2020 09:23
Show Gist options
  • Save rkben/fe56e80be96687bbdc4b97d9308921c2 to your computer and use it in GitHub Desktop.
Save rkben/fe56e80be96687bbdc4b97d9308921c2 to your computer and use it in GitHub Desktop.
#!/bin/sh
dir_path=$HOME/.steam/root/compatibilitytools.d/
res=`curl -Ls https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest`
download_url=`echo $res | jq -r '.assets[0].browser_download_url'`
latest_version=`echo $res | jq -r '.tag_name'`
html_url=`echo $res | jq -r '.html_url'`
download_proton() {
echo Downloading $download_url
curl -L $download_url --output /tmp/proton_update.tar.gz
tar -xf /tmp/proton_update.tar.gz -C $dir_path
rm /tmp/proton_update.tar.gz
}
dump_info() {
echo $latest_version > $dir_path/current
}
if [ ! -d $dir_path ]
then
echo $dir_path does not exist, creating
mkdir -pv $dir_path
download_proton
dump_info
echo Updated to: $latest_version
exit 0
fi
current_version=`head -n1 $dir_path/current`
if [ $current_version = $latest_version ]
then
echo Change Log: $html_url
echo $current_version equals $latest_version exiting
else
echo Current: $current_version\nNew: $latest_version
echo Removing and updating
rm -vrf $dir_path/*
download_proton
dump_info
echo Change Log: $html_url
echo Updated to: $latest_version
exit 0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment