mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-14 11:04:29 +05:00
script: change kiauh update notification to a dialog
This commit is contained in:
@@ -31,17 +31,17 @@ print_header(){
|
|||||||
|
|
||||||
kiauh_update_msg(){
|
kiauh_update_msg(){
|
||||||
top_border
|
top_border
|
||||||
echo -e "| ${yellow}There is a newer version of this script available!${default} | "
|
echo -e "|${green} New KIAUH update available! ${default}| "
|
||||||
echo -e "| ${yellow}Type 'update' if you want to update KIAUH now.${default} | "
|
hr
|
||||||
blank_line
|
echo -e "|${yellow} It is recommended to keep KIAUH up to date. Updates ${default}| "
|
||||||
echo -e "| ${yellow}Check out the KIAUH changelog for important changes${default} | "
|
echo -e "|${yellow} usually contain bugfixes, important changes or new ${default}| "
|
||||||
echo -e "| ${yellow}either to the script or the installable components!${default} | "
|
echo -e "|${yellow} features. Please consider updating! ${default}| "
|
||||||
bottom_border
|
bottom_border
|
||||||
}
|
}
|
||||||
|
|
||||||
##############################################################################################
|
################################################################################
|
||||||
#********************************************************************************************#
|
#******************************************************************************#
|
||||||
##############################################################################################
|
################################################################################
|
||||||
### TODO: rework other menus to make use of the following functions too and make them more readable
|
### TODO: rework other menus to make use of the following functions too and make them more readable
|
||||||
|
|
||||||
do_action(){
|
do_action(){
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
main_ui(){
|
main_ui(){
|
||||||
|
#[ $KIAUH_UPDATE_REMIND="true" ] && kiauh_update_reminder
|
||||||
top_border
|
top_border
|
||||||
echo -e "| $(title_msg "~~~~~~~~~~~~~~~ [ Main Menu ] ~~~~~~~~~~~~~~~") |"
|
echo -e "| $(title_msg "~~~~~~~~~~~~~~~ [ Main Menu ] ~~~~~~~~~~~~~~~") |"
|
||||||
hr
|
hr
|
||||||
@@ -22,11 +23,26 @@ print_kiauh_version(){
|
|||||||
KIAUH_VER="$(printf "%-20s" "$KIAUH_VER")"
|
KIAUH_VER="$(printf "%-20s" "$KIAUH_VER")"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
kiauh_update_dialog(){
|
||||||
|
kiauh_update_msg
|
||||||
|
read -p "${cyan}Do you want to update now? (Y/n):${default} " yn
|
||||||
|
while true; do
|
||||||
|
case "$yn" in
|
||||||
|
Y|y|Yes|yes|"")
|
||||||
|
do_action "update_kiauh"
|
||||||
|
break;;
|
||||||
|
N|n|No|no) break;;
|
||||||
|
*)
|
||||||
|
deny_action "kiauh_update_dialog";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
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" = "true" ]; then
|
if [ "$KIAUH_UPDATE_AVAIL" = "true" ]; then
|
||||||
kiauh_update_msg
|
kiauh_update_dialog
|
||||||
fi
|
fi
|
||||||
#check install status
|
#check install status
|
||||||
print_kiauh_version
|
print_kiauh_version
|
||||||
|
|||||||
Reference in New Issue
Block a user