mirror of
https://github.com/tw93/Mole.git
synced 2026-02-16 12:21:11 +00:00
chore: auto format code
This commit is contained in:
@@ -342,12 +342,12 @@ select_purge_categories() {
|
|||||||
selected[cursor_pos]=true
|
selected[cursor_pos]=true
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
"a"|"A") # Select all
|
"a" | "A") # Select all
|
||||||
for ((i = 0; i < total_items; i++)); do
|
for ((i = 0; i < total_items; i++)); do
|
||||||
selected[i]=true
|
selected[i]=true
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
"i"|"I") # Invert selection
|
"i" | "I") # Invert selection
|
||||||
for ((i = 0; i < total_items; i++)); do
|
for ((i = 0; i < total_items; i++)); do
|
||||||
if [[ ${selected[i]} == true ]]; then
|
if [[ ${selected[i]} == true ]]; then
|
||||||
selected[i]=false
|
selected[i]=false
|
||||||
@@ -356,11 +356,11 @@ select_purge_categories() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
"q"|"Q"|$'\x03') # Quit or Ctrl-C
|
"q" | "Q" | $'\x03') # Quit or Ctrl-C
|
||||||
restore_terminal
|
restore_terminal
|
||||||
return 1
|
return 1
|
||||||
;;
|
;;
|
||||||
""|$'\n'|$'\r') # Enter - confirm
|
"" | $'\n' | $'\r') # Enter - confirm
|
||||||
# Build result
|
# Build result
|
||||||
PURGE_SELECTION_RESULT=""
|
PURGE_SELECTION_RESULT=""
|
||||||
for ((i = 0; i < total_items; i++)); do
|
for ((i = 0; i < total_items; i++)); do
|
||||||
@@ -505,7 +505,7 @@ clean_project_artifacts() {
|
|||||||
local size_str="$3"
|
local size_str="$3"
|
||||||
|
|
||||||
# Terminal width for alignment
|
# Terminal width for alignment
|
||||||
local terminal_width=$(tput cols 2>/dev/null || echo 80)
|
local terminal_width=$(tput cols 2> /dev/null || echo 80)
|
||||||
local fixed_width=28 # Reserve for type and size
|
local fixed_width=28 # Reserve for type and size
|
||||||
local available_width=$((terminal_width - fixed_width))
|
local available_width=$((terminal_width - fixed_width))
|
||||||
|
|
||||||
@@ -551,8 +551,14 @@ clean_project_artifacts() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Set global vars for selector
|
# Set global vars for selector
|
||||||
export PURGE_CATEGORY_SIZES=$(IFS=,; echo "${item_sizes[*]}")
|
export PURGE_CATEGORY_SIZES=$(
|
||||||
export PURGE_RECENT_CATEGORIES=$(IFS=,; echo "${item_recent_flags[*]}")
|
IFS=,
|
||||||
|
echo "${item_sizes[*]}"
|
||||||
|
)
|
||||||
|
export PURGE_RECENT_CATEGORIES=$(
|
||||||
|
IFS=,
|
||||||
|
echo "${item_recent_flags[*]}"
|
||||||
|
)
|
||||||
|
|
||||||
# Interactive selection (only if terminal is available)
|
# Interactive selection (only if terminal is available)
|
||||||
PURGE_SELECTION_RESULT=""
|
PURGE_SELECTION_RESULT=""
|
||||||
@@ -609,7 +615,7 @@ clean_project_artifacts() {
|
|||||||
|
|
||||||
# Update stats
|
# Update stats
|
||||||
if [[ ! -e "$item_path" ]]; then
|
if [[ ! -e "$item_path" ]]; then
|
||||||
local current_total=$(cat "$stats_dir/purge_stats" 2>/dev/null || echo "0")
|
local current_total=$(cat "$stats_dir/purge_stats" 2> /dev/null || echo "0")
|
||||||
echo "$((current_total + size_kb))" > "$stats_dir/purge_stats"
|
echo "$((current_total + size_kb))" > "$stats_dir/purge_stats"
|
||||||
((cleaned_count++))
|
((cleaned_count++))
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user