shellcheck: apply fix for SC2086

This commit is contained in:
th33xitus
2021-12-19 17:14:24 +01:00
parent b06c17c184
commit 7afe943ecc

View File

@@ -101,12 +101,12 @@ select_mcu_id(){
done done
### verify user input ### verify user input
sel_index="" sel_index=""
while [[ ! ($sel_index =~ ^[1-9]+$) ]] || [ $sel_index -gt $id ]; do while [[ ! ($sel_index =~ ^[1-9]+$) ]] || [ "$sel_index" -gt "$id" ]; do
echo echo
read -p "${cyan}###### Select MCU to flash:${default} " sel_index read -p "${cyan}###### Select MCU to flash:${default} " sel_index
if [[ ! ($sel_index =~ ^[1-9]+$) ]]; then if [[ ! ($sel_index =~ ^[1-9]+$) ]]; then
warn_msg "Invalid input!" warn_msg "Invalid input!"
elif [ $sel_index -lt 1 ] || [ $sel_index -gt $id ]; then elif [ "$sel_index" -lt 1 ] || [ "$sel_index" -gt "$id" ]; then
warn_msg "Please select a number between 1 and $id!" warn_msg "Please select a number between 1 and $id!"
fi fi
mcu_index=$(echo $((sel_index - 1))) mcu_index=$(echo $((sel_index - 1)))
@@ -177,9 +177,9 @@ flash_mcu_sd(){
### make the user select one of the boards ### make the user select one of the boards
while true; do while true; do
read -p "${cyan}###### Please select board type:${default} " choice read -p "${cyan}###### Please select board type:${default} " choice
if [ $choice = "q" ] || [ $choice = "Q" ]; then if [ "$choice" = "q" ] || [ "$choice" = "Q" ]; then
clear && advanced_menu && break clear && advanced_menu && break
elif [ $choice -le ${#board_list[@]} ]; then elif [ "$choice" -le ${#board_list[@]} ]; then
selected_board="${board_list[$choice]}" selected_board="${board_list[$choice]}"
break break
else else
@@ -220,8 +220,8 @@ flash_mcu_sd(){
} }
build_fw(){ build_fw(){
if [ -d $KLIPPER_DIR ]; then if [ -d "$KLIPPER_DIR" ]; then
cd $KLIPPER_DIR cd "$KLIPPER_DIR"
status_msg "Initializing firmware build ..." status_msg "Initializing firmware build ..."
dep=(build-essential dpkg-dev make) dep=(build-essential dpkg-dev make)
dependency_check dependency_check