Make auto update more forgiving

plexupdate.sh should not fail because autoupdate cannot proceed.
This commit is contained in:
Henric Andersson 2017-02-16 19:32:52 -08:00
parent 6093805856
commit 9b0ec5de9d

View file

@ -340,15 +340,10 @@ if [ "${AUTOUPDATE}" = "yes" ]; then
pushd "$(dirname "$0")" >/dev/null
if [ ! -d .git ]; then
error "This is not a git repository. Auto-update only works if you've done a git clone"
exit 1
fi
if ! git diff --quiet; then
error "You have made changes to the plexupdate files, cannot auto update"
exit 1
fi
warn "This is not a git repository. Auto-update only works if you've done a git clone"
elif ! git diff --quiet; then
warn "You have made changes to the plexupdate files, cannot auto update"
else
# Force FETCH_HEAD to point to the correct branch (for older versions of git which don't default to current branch)
if git fetch origin $BRANCHNAME --quiet && ! git diff --quiet FETCH_HEAD; then
info "Auto-updating..."
@ -391,6 +386,7 @@ if [ "${AUTOUPDATE}" = "yes" ]; then
exit $?
fi
fi
fi
#we may have already returned, so ignore any errors as well
popd &>/dev/null