style: fix code style

Signed-off-by: Dominik Willner th33xitus@gmail.com
This commit is contained in:
th33xitus
2022-05-27 11:12:20 +02:00
parent 6f9d22fe80
commit 64a6ba462a
6 changed files with 11 additions and 10 deletions

View File

@@ -222,7 +222,7 @@ function start_flash_sd() {
else else
printf "| ${i}) %-49s|\n" "${board_list[${i}]}" printf "| ${i}) %-49s|\n" "${board_list[${i}]}"
fi fi
i=$((i + 1)) i=$(( i + 1 ))
done done
quit_footer quit_footer

View File

@@ -259,8 +259,8 @@ function klipper_setup() {
### confirm message ### confirm message
local confirm="" local confirm=""
(( instance_arr[0] == 1)) && confirm="Klipper has been set up!" (( instance_arr[0] == 1 )) && confirm="Klipper has been set up!"
(( instance_arr[0] > 1)) && confirm="${instance_arr[0]} Klipper instances have been set up!" (( instance_arr[0] > 1 )) && confirm="${instance_arr[0]} Klipper instances have been set up!"
print_confirm "${confirm}" && return print_confirm "${confirm}" && return
} }
@@ -515,16 +515,16 @@ function get_klipper_status() {
### count+1 for each found data-item from array ### count+1 for each found data-item from array
local filecount=0 local filecount=0
for data in "${data_arr[@]}"; do for data in "${data_arr[@]}"; do
[[ -e ${data} ]] && filecount=$(("${filecount}" + 1)) [[ -e ${data} ]] && filecount=$(( filecount + 1 ))
done done
if (( filecount == ${#data_arr[*]})); then if (( filecount == ${#data_arr[*]} )); then
if (( py_ver == 3 )); then if (( py_ver == 3 )); then
status="Installed: ${sf_count}(py${py_ver})" status="Installed: ${sf_count}(py${py_ver})"
else else
status="Installed: ${sf_count}" status="Installed: ${sf_count}"
fi fi
elif ((filecount == 0)); then elif (( filecount == 0 )); then
status="Not installed!" status="Not installed!"
else else
status="Incomplete!" status="Incomplete!"

View File

@@ -356,6 +356,7 @@ function ms_theme_installer_menu() {
theme_repo+=("${col4}") theme_repo+=("${col4}")
done <<< "${theme_list}" done <<< "${theme_list}"
local option
while true; do while true; do
read -p "${cyan}Install theme:${white} " option read -p "${cyan}Install theme:${white} " option
if (( option > 0 && option < ${#theme_name[@]} )); then if (( option > 0 && option < ${#theme_name[@]} )); then

View File

@@ -209,7 +209,7 @@ function create_telegram_conf() {
elif (( telegram_bot_count > 1 )); then elif (( telegram_bot_count > 1 )); then
local j=0 re="^[1-9][0-9]*$" local j=0 re="^[1-9][0-9]*$"
for ((i=1; i <= telegram_bot_count; i++ )); do for (( i=1; i <= telegram_bot_count; i++ )); do
### overwrite config folder if name is only a number ### overwrite config folder if name is only a number
if [[ ${names[j]} =~ ${re} ]]; then if [[ ${names[j]} =~ ${re} ]]; then
cfg_dir="${KLIPPER_CONFIG}/printer_${names[${j}]}" cfg_dir="${KLIPPER_CONFIG}/printer_${names[${j}]}"
@@ -219,7 +219,7 @@ function create_telegram_conf() {
### write multi instance config ### write multi instance config
write_telegram_conf "${cfg_dir}" "${cfg}" "${log}" write_telegram_conf "${cfg_dir}" "${cfg}" "${log}"
j=$((j+1)) j=$(( j + 1 ))
done && unset j done && unset j
else else

View File

@@ -391,7 +391,7 @@ function get_octoprint_status() {
if (( sf_count == 0 )) && (( env_count == 0 )) && (( dir_count == 0 )); then if (( sf_count == 0 )) && (( env_count == 0 )) && (( dir_count == 0 )); then
status="Not installed!" status="Not installed!"
elif (( sf_count == env_count)) && (( sf_count == dir_count )); then elif (( sf_count == env_count )) && (( sf_count == dir_count )); then
status="Installed: ${sf_count}" status="Installed: ${sf_count}"
else else
status="Incomplete!" status="Incomplete!"

View File

@@ -65,7 +65,7 @@ function rollback_component() {
local count local count
while true; do while true; do
read -p "${cyan}###### Revert this amount of commits:${white} " count read -p "${cyan}###### Revert this amount of commits:${white} " count
if [[ -n ${count} ]] && ((count > 0)); then if [[ -n ${count} ]] && (( count > 0 )); then
status_msg "Revert ${component^} by ${count} commits ..." status_msg "Revert ${component^} by ${count} commits ..."
cd "${HOME}/${component}" cd "${HOME}/${component}"
if git reset --hard HEAD~"${count}"; then if git reset --hard HEAD~"${count}"; then