style: improve code-style and fix some shellcheck warnings
Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
@@ -39,6 +39,8 @@ function update_ui() {
|
||||
function update_menu() {
|
||||
unset update_arr
|
||||
do_action "" "update_ui"
|
||||
|
||||
local action
|
||||
while true; do
|
||||
read -p "${cyan}####### Perform action:${white} " action
|
||||
case "${action}" in
|
||||
@@ -73,44 +75,48 @@ function update_menu() {
|
||||
|
||||
function update_all() {
|
||||
while true; do
|
||||
if [ "${#update_arr[@]}" = "0" ]; then
|
||||
CONFIRM_MSG="Everything is already up to date!"
|
||||
if (( ${#update_arr[@]} == 0 )); then
|
||||
print_confirm "Everything is already up-to-date!"
|
||||
echo; break
|
||||
fi
|
||||
|
||||
echo
|
||||
top_border
|
||||
echo -e "| The following installations will be updated: |"
|
||||
if [ "$KLIPPER_UPDATE_AVAIL" = "true" ]; then
|
||||
if [[ "${KLIPPER_UPDATE_AVAIL}" = "true" ]]; then
|
||||
echo -e "| ${cyan}● Klipper${white} |"
|
||||
fi
|
||||
if [ "${MOONRAKER_UPDATE_AVAIL}" = "true" ]; then
|
||||
if [[ "${MOONRAKER_UPDATE_AVAIL}" = "true" ]]; then
|
||||
echo -e "| ${cyan}● Moonraker${white} |"
|
||||
fi
|
||||
if [ "${MAINSAIL_UPDATE_AVAIL}" = "true" ]; then
|
||||
if [[ "${MAINSAIL_UPDATE_AVAIL}" = "true" ]]; then
|
||||
echo -e "| ${cyan}● Mainsail${white} |"
|
||||
fi
|
||||
if [ "${FLUIDD_UPDATE_AVAIL}" = "true" ]; then
|
||||
if [[ "${FLUIDD_UPDATE_AVAIL}" = "true" ]]; then
|
||||
echo -e "| ${cyan}● Fluidd${white} |"
|
||||
fi
|
||||
if [ "${KLIPPERSCREEN_UPDATE_AVAIL}" = "true" ]; then
|
||||
if [[ "${KLIPPERSCREEN_UPDATE_AVAIL}" = "true" ]]; then
|
||||
echo -e "| ${cyan}● KlipperScreen${white} |"
|
||||
fi
|
||||
if [ "${PGC_UPDATE_AVAIL}" = "true" ]; then
|
||||
if [[ "${PGC_UPDATE_AVAIL}" = "true" ]]; then
|
||||
echo -e "| ${cyan}● PrettyGCode for Klipper${white} |"
|
||||
fi
|
||||
if [ "${MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL}" = "true" ]; then
|
||||
if [[ "${MOONRAKER_TELEGRAM_BOT_UPDATE_AVAIL}" = "true" ]]; then
|
||||
echo -e "| ${cyan}● MoonrakerTelegramBot${white} |"
|
||||
fi
|
||||
if [ "${SYS_UPDATE_AVAIL}" = "true" ]; then
|
||||
if [[ "${SYS_UPDATE_AVAIL}" = "true" ]]; then
|
||||
echo -e "| ${cyan}● System${white} |"
|
||||
fi
|
||||
bottom_border
|
||||
if [ "${#update_arr[@]}" != "0" ]; then
|
||||
|
||||
local yn
|
||||
if (( ${#update_arr[@]} != 0 )); then
|
||||
read -p "${cyan}###### Do you want to proceed? (Y/n):${white} " yn
|
||||
case "$yn" in
|
||||
case "${yn}" in
|
||||
Y|y|Yes|yes|"")
|
||||
for update in "${update_arr[@]}"
|
||||
do
|
||||
#shellcheck disable=SC2250
|
||||
$update
|
||||
done
|
||||
break;;
|
||||
|
||||
Reference in New Issue
Block a user