From 2890635633ed5a782b3996a111c4fedb8d1d20b2 Mon Sep 17 00:00:00 2001 From: Alexander Gehrke Date: Mon, 15 Nov 2021 12:38:31 +0100 Subject: [PATCH] install-proton-ge.zsh: don't save installed tag, if installation fails --- misc/install-proton-ge.zsh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/misc/install-proton-ge.zsh b/misc/install-proton-ge.zsh index cae0def..3822ab7 100755 --- a/misc/install-proton-ge.zsh +++ b/misc/install-proton-ge.zsh @@ -20,13 +20,15 @@ mkdir -p $COMPTOOLSDIR latest_json=$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest) release_tag=$(jq -r .tag_name <<<$latest_json) +download_url=$(jq -r '.assets|map(select(.name | contains("tar")))|.[0].browser_download_url'<<<"$latest_json") installed_tags="$COMPTOOLSDIR/proton-ge-tags" if grep -q "^$release_tag\$" "$installed_tags"; then echo "${fg_bold[yellow]}Current release $release_tag already installed.$reset_color" else - echo $release_tag >> $COMPTOOLSDIR/proton-ge-tags - curl -L $(jq -r '.assets[0].browser_download_url'<<<"$latest_json") | tar -C $COMPTOOLSDIR -xvz - echo "${fg_bold[green]}Installed release $release_tag.$reset_color" + echo "Downloading $download_url" + curl -L $download_url | tar -xvz -C $COMPTOOLSDIR \ + && echo $release_tag >> $installed_tags \ + && echo "${fg_bold[green]}Installed release $release_tag.$reset_color" fi