Skip to content

Commit ded3126

Browse files
committed
fix: unused variables, syntax errors, and import warnings reported by Shellcheck
1 parent 00ba339 commit ded3126

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

bleach

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,35 @@
55
set -Eeuo pipefail
66

77
# ---------------- CONFIGURATION ----------------
8-
export BLEACH_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8+
# ---------------- CONFIGURATION ----------------
9+
export BLEACH_ROOT
10+
BLEACH_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
911
export SRC_DIR="${BLEACH_ROOT}/src"
1012
export CORE_DIR="${SRC_DIR}/core"
1113
export MODULES_DIR="${SRC_DIR}/modules"
1214

1315
# ---------------- IMPORTS ----------------
16+
# shellcheck disable=SC1091
1417
source "${CORE_DIR}/tui.sh"
18+
# shellcheck disable=SC1091
1519
source "${CORE_DIR}/logging.sh"
20+
# shellcheck disable=SC1091
1621
source "${CORE_DIR}/state.sh"
22+
# shellcheck disable=SC1091
1723
source "${CORE_DIR}/self_update.sh"
1824

1925
# Source Modules for direct access (Auto-Clean)
26+
# shellcheck disable=SC1091
2027
source "${MODULES_DIR}/cleanup/apt.sh"
28+
# shellcheck disable=SC1091
2129
source "${MODULES_DIR}/cleanup/docker.sh"
30+
# shellcheck disable=SC1091
2231
source "${MODULES_DIR}/cleanup/logs.sh"
32+
# shellcheck disable=SC1091
2333
source "${MODULES_DIR}/cleanup/ide.sh"
34+
# shellcheck disable=SC1091
2435
source "${MODULES_DIR}/cleanup/dev.sh"
36+
# shellcheck disable=SC1091
2537
source "${MODULES_DIR}/cleanup/system.sh"
2638

2739
# ---------------- MAIN ----------------
@@ -71,7 +83,8 @@ main() {
7183
# Weekly Auto-Update Check (Interactive)
7284
# Check timestamp file
7385
local last_check_file="${HOME}/.local/share/bleach/last_update_check"
74-
local current_time=$(date +%s)
86+
local current_time
87+
current_time=$(date +%s)
7588
local last_check=0
7689

7790
if [[ -f "$last_check_file" ]]; then
@@ -119,16 +132,16 @@ main() {
119132
HEADER=$(draw_header "$ACTIVE_TAB")
120133

121134
# Sub-header / Status / Freed Space
122-
STATUS_BAR=$(gum style --foreground 240 --width $(tput cols) --align center "$freed_text")
135+
STATUS_BAR=$(gum style --foreground 240 --width "$(tput cols)" --align center "$freed_text")
123136
FULL_HEADER=$(gum join --vertical "$HEADER" "$STATUS_BAR")
124137

125138
# Menu Options based on Active Tab
126139
# To simulate tabs, the menu items change based on the active tab context.
127140
# But user can also switch tabs.
128141

129142
# Navigation Items (Always present)
130-
local nav_items=("> System Cleanup" "> System Updates" "> Maintenance" "> View Logs" "> Exit")
131-
143+
# nav_items removed as gum choose is used directly
144+
132145
# We need a unified list.
133146
# Strategy: The "Tab" is just visual context. The Menu is the controller.
134147

@@ -185,18 +198,22 @@ run_module_menu() {
185198
local category=$1
186199
case "$category" in
187200
"cleanup")
201+
# shellcheck disable=SC1091
188202
source "${MODULES_DIR}/cleanup/main.sh"
189203
run_cleanup_menu
190204
;;
191205
"updates")
206+
# shellcheck disable=SC1091
192207
source "${MODULES_DIR}/updates/main.sh"
193208
run_updates_menu
194209
;;
195210
"maintenance")
211+
# shellcheck disable=SC1091
196212
source "${MODULES_DIR}/maintenance/main.sh"
197213
run_maintenance_menu
198214
;;
199215
"gaming")
216+
# shellcheck disable=SC1091
200217
source "${MODULES_DIR}/gaming/main.sh"
201218
run_gaming_menu
202219
;;

0 commit comments

Comments
 (0)