Skip to content

Commit 12c8ca2

Browse files
author
Chris Cowan
committed
add a shellcheck ignore for an externally used variable
1 parent d2fee41 commit 12c8ca2

File tree

2 files changed

+5
-39
lines changed

2 files changed

+5
-39
lines changed

.github/workflows/main.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

cal-tui.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ cal-tui::main_menu_return_index() {
146146
local max_len=0
147147
for line in "${menu_lines[@]}"; do
148148
# Remove ANSI escape codes before counting length
149-
local stripped=$(echo -e "$line" | sed 's/\x1B\[[0-9;]*[a-zA-Z]//g')
149+
local stripped
150+
stripped=$(echo -e "$line" | sed 's/\x1B\[[0-9;]*[a-zA-Z]//g')
150151
local len=${#stripped}
151152
(( len > max_len )) && max_len=$len
152153
done
@@ -160,7 +161,7 @@ cal-tui::main_menu_return_index() {
160161

161162
# Print each line at the same horizontal offset
162163
for line in "${menu_lines[@]}"; do
163-
printf "%*s%s\n" "$start_col" "" "$line"
164+
printf "%*s%s\n" "$start_col" "" "$line"
164165
done
165166

166167
# Input prompt aligned to the same column
@@ -171,7 +172,8 @@ cal-tui::main_menu_return_index() {
171172
if [[ "$choice" -eq 0 ]]; then
172173
return 1
173174
fi
174-
RETURNED_INDEX=$((choice - 1))
175+
# shellcheck disable=SC2034
176+
RETURNED_INDEX=$((choice - 1)) # Used externally as the choice result
175177
return 0
176178
else
177179
cal-tui::print_error "Invalid choice. Try again."

0 commit comments

Comments
 (0)