From c98584dde8472421101247a97cae862dd1dfdb85 Mon Sep 17 00:00:00 2001 From: th33xitus <> Date: Sun, 6 Sep 2020 11:16:34 +0200 Subject: [PATCH] bugfix: kiauh status check prevents kiauh from starting if no kiauh .git directory present --- scripts/status.sh | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/scripts/status.sh b/scripts/status.sh index a96c79c..1cde011 100755 --- a/scripts/status.sh +++ b/scripts/status.sh @@ -1,15 +1,17 @@ kiauh_status(){ - cd ${HOME}/kiauh - git fetch --all -q - if git branch -a | grep "* master" -q; then - CURR_KIAUH_BRANCH="master" #needed to display branch in UI - if [[ "$(git rev-parse --short=8 origin/master)" != "$(git rev-parse --short=8 HEAD)" ]]; then - KIAUH_UPDATE_AVAIL="true" - fi - elif git branch -a | grep "* dev-2.0" -q; then - CURR_KIAUH_BRANCH="dev-2.0" #needed to display branch in UI - if [[ "$(git rev-parse --short=8 origin/dev-2.0)" != "$(git rev-parse --short=8 HEAD)" ]]; then - KIAUH_UPDATE_AVAIL="true" + if [ -d {$HOME}/kiauh/.git ]; then + cd ${HOME}/kiauh + git fetch --all -q + if git branch -a | grep "* master" -q; then + CURR_KIAUH_BRANCH="master" #needed to display branch in UI + if [[ "$(git rev-parse --short=8 origin/master)" != "$(git rev-parse --short=8 HEAD)" ]]; then + KIAUH_UPDATE_AVAIL="true" + fi + elif git branch -a | grep "* dev-2.0" -q; then + CURR_KIAUH_BRANCH="dev-2.0" #needed to display branch in UI + if [[ "$(git rev-parse --short=8 origin/dev-2.0)" != "$(git rev-parse --short=8 HEAD)" ]]; then + KIAUH_UPDATE_AVAIL="true" + fi fi fi }