Added check for updates function. Hopefully this doesn't break stuff horribly.
This commit is contained in:
parent
223a262e61
commit
953a565467
@ -45,6 +45,20 @@ EOF
|
|||||||
export DIALOGOPTS='--no-lines --visit-items'
|
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
|
# Function to open urls
|
||||||
open_url() {
|
open_url() {
|
||||||
xdg-open "${*}" 2> /dev/null
|
xdg-open "${*}" 2> /dev/null
|
||||||
@ -285,6 +299,7 @@ for i in "${requiredPackages}" ; do
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
check_update
|
||||||
# With no arguments, open the game launcher.
|
# With no arguments, open the game launcher.
|
||||||
if [[ $# -eq 0 ]]; then
|
if [[ $# -eq 0 ]]; then
|
||||||
game_launcher
|
game_launcher
|
||||||
|
Loading…
Reference in New Issue
Block a user