From 7614d596ab3d0c1c35cb2f13072da7c98ee12de3 Mon Sep 17 00:00:00 2001 From: th33xitus <> Date: Sat, 15 Aug 2020 10:01:32 +0200 Subject: [PATCH] fix: kiauh update function --- kiauh.sh | 2 +- scripts/status.sh | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/kiauh.sh b/kiauh.sh index e9dd391..f4465c5 100755 --- a/kiauh.sh +++ b/kiauh.sh @@ -93,7 +93,7 @@ clear_msg(){ main_menu(){ print_header #print KIAUH update msg if update available - if [ $KIAUH_UPDATE_AVAIL -gt 0 ]; then + if [ "$KIAUH_UPDATE_AVAIL" = "true" ]; then kiauh_update_msg fi #check install status diff --git a/scripts/status.sh b/scripts/status.sh index 4fb54fa..9d3bfd0 100644 --- a/scripts/status.sh +++ b/scripts/status.sh @@ -4,12 +4,16 @@ kiauh_status(){ CURR_KIAUH_BRANCH=$(git branch -a | head -1 | cut -d" " -f2) if [ $CURR_KIAUH_BRANCH = "master" ]; then REMOTE_KIAUH_COMMIT=$(git rev-parse --short=8 origin/master) - #if count of new commits >0, then update available - KIAUH_UPDATE_AVAIL=$(git log ..origin/master --oneline | wc -l) + 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 REMOTE_KIAUH_COMMIT=$(git rev-parse --short=8 dev-2.0) - #if count of new commits >0, then update available - KIAUH_UPDATE_AVAIL=$(git log ..dev-2.0 --oneline | wc -l) + LOCAL_KIAUH_COMMIT=$(git rev-parse --short=8 HEAD) + if [ "$REMOTE_KIAUH_COMMIT" != "$LOCAL_KIAUH_COMMIT" ]; then + KIAUH_UPDATE_AVAIL="true" + fi fi }