install-proton-ge.zsh: don't save installed tag, if installation fails
This commit is contained in:
		
							parent
							
								
									b2f9622382
								
							
						
					
					
						commit
						2890635633
					
				
					 1 changed files with 5 additions and 3 deletions
				
			
		|  | @ -20,13 +20,15 @@ mkdir -p $COMPTOOLSDIR | ||||||
| 
 | 
 | ||||||
| latest_json=$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest) | latest_json=$(curl -s https://api.github.com/repos/GloriousEggroll/proton-ge-custom/releases/latest) | ||||||
| release_tag=$(jq -r .tag_name <<<$latest_json) | 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" | installed_tags="$COMPTOOLSDIR/proton-ge-tags" | ||||||
| 
 | 
 | ||||||
| if grep -q "^$release_tag\$" "$installed_tags"; then | if grep -q "^$release_tag\$" "$installed_tags"; then | ||||||
| 	echo "${fg_bold[yellow]}Current release $release_tag already installed.$reset_color" | 	echo "${fg_bold[yellow]}Current release $release_tag already installed.$reset_color" | ||||||
| else | else | ||||||
| 	echo $release_tag >> $COMPTOOLSDIR/proton-ge-tags | 	echo "Downloading $download_url" | ||||||
| 	curl -L $(jq -r '.assets[0].browser_download_url'<<<"$latest_json") | tar -C $COMPTOOLSDIR -xvz | 	curl -L $download_url | tar -xvz -C $COMPTOOLSDIR \ | ||||||
| 	echo "${fg_bold[green]}Installed release $release_tag.$reset_color" | 		&& echo $release_tag >> $installed_tags \ | ||||||
|  | 		&& echo "${fg_bold[green]}Installed release $release_tag.$reset_color" | ||||||
| fi | fi | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alexander Gehrke
						Alexander Gehrke