From ad72568e353e4a6bacdd1dd96737401833800f5a Mon Sep 17 00:00:00 2001 From: Michael Stanclift Date: Sat, 30 May 2020 22:42:37 -0500 Subject: [PATCH] Validate Git completion --- CHANGELOG.md | 3 ++- gravity-sync.sh | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e14dfb..c2dd2f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,8 @@ - No new Star Trek references. #### 1.7.4 -- (**Featureish**) `./gravity-sync.sh dev` will now toggle dev flag on/off. No `touch` required, although it still works that way under the covers. Improvement of methods added in 1.7.2. +- `./gravity-sync.sh dev` will now toggle dev flag on/off. No `touch` required, although it still works that way under the covers. Improvement of methods added in 1.7.2. +- `./gravity-sync.sh dev` performs better error handling. - Slightly less verbose in some places to make up for being more verbose in others. - [DONE] has become [ OK ] in output. - Tighten up verbage of some status messages. diff --git a/gravity-sync.sh b/gravity-sync.sh index 2e8c44e..7866537 100755 --- a/gravity-sync.sh +++ b/gravity-sync.sh @@ -114,15 +114,15 @@ function update_gs { MESSAGE="Requires GitHub Installation" echo_warn exit_nochange - elif [ $GIT_CHECK == "HEAD" ] - then - git fetch --all - git reset --hard origin/${BRANCH} else MESSAGE="This might break..." echo_warn - git fetch --all - git reset --hard origin/${BRANCH} + MESSAGE="Updating Cache" + echo_stat + git fetch --all >/dev/null 2>&1 + error_validate + git reset --hard origin/${BRANCH} >/dev/null 2>&1 + error_validate fi exit