Added check for updates function. Hopefully this doesn't break stuff horribly.

This commit is contained in:
Storm Dragon 2022-03-13 01:42:35 -05:00
parent 223a262e61
commit 953a565467

View File

@ -45,6 +45,20 @@ EOF
export DIALOGOPTS='--no-lines --visit-items'
# Check for updates
check_update() {
local branch="$(git rev-parse --abbrev-ref HEAD)"
local localSha="$(git rev-parse origin/${branch})"
local remoteSha="$(git rev-parse refs/remotes/origin/${branch})"
if [[ "${localSha}" == "${remoteSha}" ]]; then
return
fi
dialog --backtitle "Linux Game manager" \
--yesno "Updates are available. Would you like to update now?" -1 -1 || return
git pull
exit $?
}
# Function to open urls
open_url() {
xdg-open "${*}" 2> /dev/null
@ -285,6 +299,7 @@ for i in "${requiredPackages}" ; do
exit 1
fi
done
check_update
# With no arguments, open the game launcher.
if [[ $# -eq 0 ]]; then
game_launcher