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 if [[ "$url" =~ ^ssh://|git@ ]] || [[ -z "$url" ]]; then
return return
fi fi
git fetch git remote update &> /dev/null
local branch="$(git rev-parse --abbrev-ref HEAD 2> /dev/null)" local upstream='@{u}'
local localSha="$(git rev-parse origin/${branch})" local home="$(git rev-parse @)"
local remoteSha="$(git rev-parse refs/remotes/origin/${branch})" local remote="$(git rev-parse "$upstream")"
if [[ "${localSha}" == "${remoteSha}" ]]; then if [[ "$home" == "$remote" ]]; then
return return
fi fi
dialog --backtitle "Linux Game manager" \ 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 git pull
exit $? exit $?
} }