From 033ba2604131fa33d91a88bb9878f5873369cf89 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Sat, 28 Jan 2017 20:00:02 -0500 Subject: [PATCH] Stay in repo directory until we error check --- advanced/Scripts/update.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/advanced/Scripts/update.sh b/advanced/Scripts/update.sh index df71e9a9..10afded4 100755 --- a/advanced/Scripts/update.sh +++ b/advanced/Scripts/update.sh @@ -105,9 +105,6 @@ GitCheckUpdateAvail() { # defaults to the current one. REMOTE="$(git rev-parse @{upstream})" - # Change back to original directory - cd "${curdir}" - if [[ ${#LOCAL} == 0 ]]; then echo "::: Error: Local revision could not be optained, ask Pi-hole support." echo "::: Additional debugging output:" @@ -120,6 +117,9 @@ GitCheckUpdateAvail() { git status exit fi + + # Change back to original directory + cd "${curdir}" if [[ "${LOCAL}" != "${REMOTE}" ]]; then # Local branch is behind remote branch -> Update