From 3076d400a02edd05f01521d98aad494dcaade381 Mon Sep 17 00:00:00 2001 From: th33xitus <> Date: Sat, 15 Aug 2020 19:03:44 +0200 Subject: [PATCH] fix: kiauh update check --- scripts/status.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/status.sh b/scripts/status.sh index 3a53fa3..8a33bae 100644 --- a/scripts/status.sh +++ b/scripts/status.sh @@ -1,14 +1,18 @@ kiauh_status(){ cd ${HOME}/kiauh git fetch --all -q - CURR_KIAUH_BRANCH=$(git branch -a | head -1 | cut -d" " -f2) - if [ $CURR_KIAUH_BRANCH = "master" ]; then + if [ $(git branch -a | grep "* master" | cut -d" " -f2) ]; then + CURR_KIAUH_BRANCH="master" + elif [ $(git branch -a | grep "* dev-2.0" | cut -d" " -f2) ]; then + CURR_KIAUH_BRANCH="dev-2.0" + fi + if [ "$CURR_KIAUH_BRANCH" = "master" ]; then REMOTE_KIAUH_COMMIT=$(git rev-parse --short=8 origin/master) LOCAL_KIAUH_COMMIT=$(git rev-parse --short=8 HEAD) if [ "$REMOTE_KIAUH_COMMIT" != "$LOCAL_KIAUH_COMMIT" ]; then KIAUH_UPDATE_AVAIL="true" fi - elif [ $CURR_KIAUH_BRANCH = "dev-2.0" ]; then + elif [ "$CURR_KIAUH_BRANCH" = "dev-2.0" ]; then REMOTE_KIAUH_COMMIT=$(git rev-parse --short=8 dev-2.0) LOCAL_KIAUH_COMMIT=$(git rev-parse --short=8 HEAD) if [ "$REMOTE_KIAUH_COMMIT" != "$LOCAL_KIAUH_COMMIT" ]; then