mirror of
https://github.com/tw93/Mole.git
synced 2026-03-24 18:40:07 +00:00
fix(clean): align threshold colors with displayed GB units
This commit is contained in:
@@ -79,6 +79,7 @@ readonly MOLE_TM_BACKUP_SAFE_HOURS=48 # TM backup safety window (hours)
|
||||
readonly MOLE_MAX_DS_STORE_FILES=500 # Max .DS_Store files to clean per scan
|
||||
readonly MOLE_MAX_ORPHAN_ITERATIONS=100 # Max iterations for orphaned app data scan
|
||||
readonly MOLE_ONE_GIB_KB=$((1024 * 1024))
|
||||
readonly MOLE_ONE_GB_BYTES=1000000000
|
||||
|
||||
# ============================================================================
|
||||
# Whitelist Configuration
|
||||
@@ -549,12 +550,12 @@ bytes_to_human_kb() {
|
||||
bytes_to_human "$((${1:-0} * 1024))"
|
||||
}
|
||||
|
||||
# Pick a cleanup result color using the shared 1 GiB threshold.
|
||||
# Pick a cleanup result color using the displayed decimal 1 GB threshold.
|
||||
cleanup_result_color_kb() {
|
||||
local size_kb="${1:-0}"
|
||||
[[ "$size_kb" =~ ^[0-9]+$ ]] || size_kb=0
|
||||
|
||||
if ((size_kb >= MOLE_ONE_GIB_KB)); then
|
||||
if ((size_kb * 1024 >= MOLE_ONE_GB_BYTES)); then
|
||||
printf '%s' "$GREEN"
|
||||
else
|
||||
printf '%s' "$YELLOW"
|
||||
|
||||
Reference in New Issue
Block a user