From 033ba2604131fa33d91a88bb9878f5873369cf89 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Sat, 28 Jan 2017 20:00:02 -0500 Subject: [PATCH 1/2] 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 From 99a4a8001759da332a81b62810da36ffc4dc43cc Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Sat, 28 Jan 2017 17:08:38 -0800 Subject: [PATCH 2/2] Spelling --- advanced/Scripts/update.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/update.sh b/advanced/Scripts/update.sh index 10afded4..32fb712b 100755 --- a/advanced/Scripts/update.sh +++ b/advanced/Scripts/update.sh @@ -106,13 +106,13 @@ GitCheckUpdateAvail() { REMOTE="$(git rev-parse @{upstream})" if [[ ${#LOCAL} == 0 ]]; then - echo "::: Error: Local revision could not be optained, ask Pi-hole support." + echo "::: Error: Local revision could not be obtained, ask Pi-hole support." echo "::: Additional debugging output:" git status exit fi if [[ ${#REMOTE} == 0 ]]; then - echo "::: Error: Remote revision could not be optained, ask Pi-hole support." + echo "::: Error: Remote revision could not be obtained, ask Pi-hole support." echo "::: Additional debugging output:" git status exit