1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-24 18:05:14 +00:00

fix: keep dry-run yellow and align clean output colors

Keep dry-run previews yellow while reusing the 1 GiB threshold for actual cleanup results across clean modules. Add regression coverage for the shared color helper and DS_Store cleanup output.
This commit is contained in:
Tw93
2026-03-23 17:53:02 +08:00
parent 4b82b4aa70
commit 5df81a2314
8 changed files with 105 additions and 27 deletions

View File

@@ -117,7 +117,6 @@ if [[ ${#WHITELIST_PATTERNS[@]} -gt 0 ]]; then
fi
# Section tracking and summary counters.
readonly MOLE_ONE_GIB_KB=$((1024 * 1024))
total_items=0
TRACK_SECTION=0
SECTION_ACTIVITY=0
@@ -651,13 +650,8 @@ safe_clean() {
label+=" ${#targets[@]} items"
fi
local line_color=$GREEN
if ((total_size_kb < MOLE_ONE_GIB_KB)); then
line_color=$YELLOW
fi
if [[ "$DRY_RUN" == "true" ]]; then
echo -e " ${line_color}${ICON_DRY_RUN}${NC} $label${NC}, ${line_color}$size_human dry${NC}"
echo -e " ${YELLOW}${ICON_DRY_RUN}${NC} $label${NC}, ${YELLOW}$size_human dry${NC}"
local paths_temp
paths_temp=$(create_temp_file)
@@ -717,6 +711,8 @@ safe_clean() {
done
fi
else
local line_color
line_color=$(cleanup_result_color_kb "$total_size_kb")
echo -e " ${line_color}${ICON_SUCCESS}${NC} $label${NC}, ${line_color}$size_human${NC}"
fi
files_cleaned=$((files_cleaned + total_count))