mirror of
https://github.com/dw-0/kiauh.git
synced 2026-02-09 18:57:06 +05:00
fix(switch_klipper_repo): use of case didn't allow selections of 2 and above
Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
@@ -43,11 +43,16 @@ function change_klipper_repo_menu() {
|
|||||||
back_help_footer
|
back_help_footer
|
||||||
|
|
||||||
local option
|
local option
|
||||||
|
local num="^[0-9]+$"
|
||||||
|
local back="^(B|b)$"
|
||||||
|
local help="^(H|h)$"
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
read -p "${cyan}###### Perform action:${white} " option
|
read -p "${cyan}###### Perform action:${white} " option
|
||||||
case "${option}" in
|
|
||||||
0 | "$(( option < ${#repos[@]} ))")
|
if [[ ${option} =~ ${num} && ${option} -lt ${#repos[@]} ]]; then
|
||||||
select_msg "Repo: ${repos[option]} Branch: ${branches[option]}"
|
select_msg "Repo: ${repos[option]} Branch: ${branches[option]}"
|
||||||
|
|
||||||
if [[ -d ${KLIPPER_DIR} ]]; then
|
if [[ -d ${KLIPPER_DIR} ]]; then
|
||||||
top_border
|
top_border
|
||||||
echo -e "| ${red}!!! ATTENTION !!!${white} |"
|
echo -e "| ${red}!!! ATTENTION !!!${white} |"
|
||||||
@@ -77,19 +82,18 @@ function change_klipper_repo_menu() {
|
|||||||
set_custom_klipper_repo "${repos[${option}]}" "${branches[${option}]}"
|
set_custom_klipper_repo "${repos[${option}]}" "${branches[${option}]}"
|
||||||
ok_msg "This repo will now be used for new Klipper installations!\n"
|
ok_msg "This repo will now be used for new Klipper installations!\n"
|
||||||
fi
|
fi
|
||||||
break;;
|
|
||||||
B|b)
|
elif [[ ${option} =~ ${back} ]]; then
|
||||||
clear && print_header
|
clear && print_header
|
||||||
settings_menu
|
settings_menu
|
||||||
break;;
|
elif [[ ${option} =~ ${help} ]]; then
|
||||||
H|h)
|
|
||||||
clear && print_header
|
clear && print_header
|
||||||
show_custom_klipper_repo_help
|
show_custom_klipper_repo_help
|
||||||
break;;
|
else
|
||||||
*)
|
error_msg "Invalid command!"
|
||||||
error_msg "Invalid command!";;
|
fi
|
||||||
esac
|
|
||||||
done
|
done
|
||||||
|
|
||||||
change_klipper_repo_menu
|
change_klipper_repo_menu
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user