|
5 | 5 | set -Eeuo pipefail |
6 | 6 |
|
7 | 7 | # ---------------- 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)" |
9 | 11 | export SRC_DIR="${BLEACH_ROOT}/src" |
10 | 12 | export CORE_DIR="${SRC_DIR}/core" |
11 | 13 | export MODULES_DIR="${SRC_DIR}/modules" |
12 | 14 |
|
13 | 15 | # ---------------- IMPORTS ---------------- |
| 16 | +# shellcheck disable=SC1091 |
14 | 17 | source "${CORE_DIR}/tui.sh" |
| 18 | +# shellcheck disable=SC1091 |
15 | 19 | source "${CORE_DIR}/logging.sh" |
| 20 | +# shellcheck disable=SC1091 |
16 | 21 | source "${CORE_DIR}/state.sh" |
| 22 | +# shellcheck disable=SC1091 |
17 | 23 | source "${CORE_DIR}/self_update.sh" |
18 | 24 |
|
19 | 25 | # Source Modules for direct access (Auto-Clean) |
| 26 | +# shellcheck disable=SC1091 |
20 | 27 | source "${MODULES_DIR}/cleanup/apt.sh" |
| 28 | +# shellcheck disable=SC1091 |
21 | 29 | source "${MODULES_DIR}/cleanup/docker.sh" |
| 30 | +# shellcheck disable=SC1091 |
22 | 31 | source "${MODULES_DIR}/cleanup/logs.sh" |
| 32 | +# shellcheck disable=SC1091 |
23 | 33 | source "${MODULES_DIR}/cleanup/ide.sh" |
| 34 | +# shellcheck disable=SC1091 |
24 | 35 | source "${MODULES_DIR}/cleanup/dev.sh" |
| 36 | +# shellcheck disable=SC1091 |
25 | 37 | source "${MODULES_DIR}/cleanup/system.sh" |
26 | 38 |
|
27 | 39 | # ---------------- MAIN ---------------- |
@@ -71,7 +83,8 @@ main() { |
71 | 83 | # Weekly Auto-Update Check (Interactive) |
72 | 84 | # Check timestamp file |
73 | 85 | 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) |
75 | 88 | local last_check=0 |
76 | 89 |
|
77 | 90 | if [[ -f "$last_check_file" ]]; then |
@@ -119,16 +132,16 @@ main() { |
119 | 132 | HEADER=$(draw_header "$ACTIVE_TAB") |
120 | 133 |
|
121 | 134 | # 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") |
123 | 136 | FULL_HEADER=$(gum join --vertical "$HEADER" "$STATUS_BAR") |
124 | 137 |
|
125 | 138 | # Menu Options based on Active Tab |
126 | 139 | # To simulate tabs, the menu items change based on the active tab context. |
127 | 140 | # But user can also switch tabs. |
128 | 141 |
|
129 | 142 | # 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 | + |
132 | 145 | # We need a unified list. |
133 | 146 | # Strategy: The "Tab" is just visual context. The Menu is the controller. |
134 | 147 |
|
@@ -185,18 +198,22 @@ run_module_menu() { |
185 | 198 | local category=$1 |
186 | 199 | case "$category" in |
187 | 200 | "cleanup") |
| 201 | + # shellcheck disable=SC1091 |
188 | 202 | source "${MODULES_DIR}/cleanup/main.sh" |
189 | 203 | run_cleanup_menu |
190 | 204 | ;; |
191 | 205 | "updates") |
| 206 | + # shellcheck disable=SC1091 |
192 | 207 | source "${MODULES_DIR}/updates/main.sh" |
193 | 208 | run_updates_menu |
194 | 209 | ;; |
195 | 210 | "maintenance") |
| 211 | + # shellcheck disable=SC1091 |
196 | 212 | source "${MODULES_DIR}/maintenance/main.sh" |
197 | 213 | run_maintenance_menu |
198 | 214 | ;; |
199 | 215 | "gaming") |
| 216 | + # shellcheck disable=SC1091 |
200 | 217 | source "${MODULES_DIR}/gaming/main.sh" |
201 | 218 | run_gaming_menu |
202 | 219 | ;; |
|
0 commit comments