Skip to content

Commit 00ba339

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

File tree

4 files changed

+23
-17
lines changed

4 files changed

+23
-17
lines changed

src/core/self_update.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ check_for_updates() {
2222
local LOCAL
2323
local REMOTE
2424
LOCAL=$(git rev-parse HEAD)
25-
REMOTE=$(git rev-parse @{u})
25+
REMOTE=$(git rev-parse "@{u}")
2626

2727
if [[ "$LOCAL" != "$REMOTE" ]]; then
2828
return 0 # Update available

src/core/state.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
# Placeholder for state management
44
# In Bash, state is mostly environment variables or temp files
55

6-
declare -A SELECTED_TASKS
7-
86
reset_state() {
9-
SELECTED_TASKS=()
7+
# Placeholder
8+
:
109
}

src/core/tui.sh

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
11
#!/usr/bin/env bash
22

33
# Colors
4-
COLOR_PRIMARY="99" # Purpleish
5-
COLOR_SECONDARY="212" # Pinkish
6-
COLOR_ACCENT="50" # Cyan/Teal
7-
COLOR_MUTED="240" # Grey
4+
export COLOR_PRIMARY="99" # Purpleish
5+
export COLOR_SECONDARY="212" # Pinkish
6+
export COLOR_ACCENT="50" # Cyan/Teal
7+
export COLOR_MUTED="240" # Grey
88

99
# Layout Constants
10-
SIDEBAR_WIDTH=25
10+
export SIDEBAR_WIDTH=25
1111

1212
# @description Draw the Tabbed Header
1313
# @arg $1 active_tab Name of the active tab (cleanup|updates|maintenance|info)
1414
draw_header() {
1515
local active_tab=$1
16-
local tab_cleanup="Cleanup"
16+
17+
# Responsive width check
18+
local label_cleanup="Cleanup"
19+
if [[ $(tput cols) -lt 80 ]]; then
20+
label_cleanup="Clean"
21+
fi
22+
23+
local tab_cleanup="$label_cleanup"
1724
local tab_updates="Updates menu"
1825
local tab_maint="Maintenance"
1926
local tab_info="Stats"
2027

2128
# Highlight active
2229
case $active_tab in
23-
"cleanup") tab_cleanup=$(gum style --foreground "$COLOR_SECONDARY" --bold " [ Cleanup ] ") ;;
30+
"cleanup") tab_cleanup=$(gum style --foreground "$COLOR_SECONDARY" --bold " [ $label_cleanup ] ") ;;
2431
"updates") tab_updates=$(gum style --foreground "$COLOR_SECONDARY" --bold " [ Updates ] ") ;;
2532
"maintenance") tab_maint=$(gum style --foreground "$COLOR_SECONDARY" --bold " [ Maintenance ] ") ;;
2633
"info") tab_info=$(gum style --foreground "$COLOR_SECONDARY" --bold " [ Stats ] ") ;;
2734
esac
2835

29-
# Responsive width check
30-
local clean_label="System Cleanup"
31-
if [[ $(tput cols) -lt 80 ]]; then
32-
clean_label="Clean"
33-
fi
34-
3536
local header_text
3637
header_text=$(gum join --horizontal " $tab_cleanup" " $tab_updates" " $tab_maint" " $tab_info")
3738

src/modules/cleanup/main.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
#!/usr/bin/env bash
22

33
# Source sibling scripts
4+
# shellcheck disable=SC1091
45
source "${MODULES_DIR}/cleanup/apt.sh"
6+
# shellcheck disable=SC1091
57
source "${MODULES_DIR}/cleanup/docker.sh"
8+
# shellcheck disable=SC1091
69
source "${MODULES_DIR}/cleanup/logs.sh"
10+
# shellcheck disable=SC1091
711
source "${MODULES_DIR}/cleanup/ide.sh"
12+
# shellcheck disable=SC1091
813
source "${MODULES_DIR}/cleanup/dev.sh"
14+
# shellcheck disable=SC1091
915
source "${MODULES_DIR}/cleanup/system.sh"
1016

1117
run_cleanup_menu() {

0 commit comments

Comments
 (0)