mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-14 11:04:29 +05:00
fix: kiauh update function
This commit is contained in:
2
kiauh.sh
2
kiauh.sh
@@ -93,7 +93,7 @@ clear_msg(){
|
|||||||
main_menu(){
|
main_menu(){
|
||||||
print_header
|
print_header
|
||||||
#print KIAUH update msg if update available
|
#print KIAUH update msg if update available
|
||||||
if [ $KIAUH_UPDATE_AVAIL -gt 0 ]; then
|
if [ "$KIAUH_UPDATE_AVAIL" = "true" ]; then
|
||||||
kiauh_update_msg
|
kiauh_update_msg
|
||||||
fi
|
fi
|
||||||
#check install status
|
#check install status
|
||||||
|
|||||||
@@ -4,12 +4,16 @@ kiauh_status(){
|
|||||||
CURR_KIAUH_BRANCH=$(git branch -a | head -1 | cut -d" " -f2)
|
CURR_KIAUH_BRANCH=$(git branch -a | head -1 | cut -d" " -f2)
|
||||||
if [ $CURR_KIAUH_BRANCH = "master" ]; then
|
if [ $CURR_KIAUH_BRANCH = "master" ]; then
|
||||||
REMOTE_KIAUH_COMMIT=$(git rev-parse --short=8 origin/master)
|
REMOTE_KIAUH_COMMIT=$(git rev-parse --short=8 origin/master)
|
||||||
#if count of new commits >0, then update available
|
LOCAL_KIAUH_COMMIT=$(git rev-parse --short=8 HEAD)
|
||||||
KIAUH_UPDATE_AVAIL=$(git log ..origin/master --oneline | wc -l)
|
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)
|
REMOTE_KIAUH_COMMIT=$(git rev-parse --short=8 dev-2.0)
|
||||||
#if count of new commits >0, then update available
|
LOCAL_KIAUH_COMMIT=$(git rev-parse --short=8 HEAD)
|
||||||
KIAUH_UPDATE_AVAIL=$(git log ..dev-2.0 --oneline | wc -l)
|
if [ "$REMOTE_KIAUH_COMMIT" != "$LOCAL_KIAUH_COMMIT" ]; then
|
||||||
|
KIAUH_UPDATE_AVAIL="true"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user