One more attempt to fix the update function.

This commit is contained in:
Storm Dragon 2022-03-15 02:07:13 -04:00
parent fe7aeea2e8
commit 3cd97dc044

View File

@ -51,15 +51,15 @@ check_update() {
if [[ "$url" =~ ^ssh://|git@ ]] || [[ -z "$url" ]]; then
return
fi
git fetch
local branch="$(git rev-parse --abbrev-ref HEAD 2> /dev/null)"
local localSha="$(git rev-parse origin/${branch})"
local remoteSha="$(git rev-parse refs/remotes/origin/${branch})"
if [[ "${localSha}" == "${remoteSha}" ]]; then
return
fi
git remote update &> /dev/null
local upstream='@{u}'
local home="$(git rev-parse @)"
local remote="$(git rev-parse "$upstream")"
if [[ "$home" == "$remote" ]]; then
return
fi
dialog --backtitle "Linux Game manager" \
--yesno "Updates are available. Would you like to update now?" -1 -1 || return
--yesno "Updates are available. Would you like to update now?" -1 -1 --stdout || return
git pull
exit $?
}