Created
August 27, 2019 11:59
-
-
Save dac73/d14e9cbabf921c47ffeeae4962d57acd to your computer and use it in GitHub Desktop.
Update MellowPlayer flatpak
This file contains 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 | |
set -e | |
NEW_VERSION=`curl -s https://gitlab.com/api/v4/projects/9602590/releases | jq -r '.[0].name'` | |
CURRENT_VERSION=`com.gitlab.ColinDuquesnoy.MellowPlayer -v 2>&1 /dev/null | grep -i MellowPlayer | cut -d' ' -f2-` | |
echo -e "Local Version: \e[95m$CURRENT_VERSION\e[0m Remote Version: \e[95m$NEW_VERSION\e[0m" | |
if [[ ${NEW_VERSION:0:5} == ${CURRENT_VERSION:0:5} ]]; then | |
echo "Update not needed!" | |
exit | |
fi | |
read -r -p "Update? [Y/n]" response | |
response=${response,,} # tolower | |
if [[ $response =~ ^(yes|y| ) ]] || [[ -z $response ]]; then | |
curl -L https://bintray.com/colinduquesnoy/MellowPlayer/download_file?file_path=stable%2F$NEW_VERSION%2FMellowPlayer.flatpak -o /tmp/mellow_player_$NEW_VERSION.flatpak | |
flatpak install --user /tmp/mellow_player_$NEW_VERSION.flatpak | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment