1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-24 06:05:07 +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

@@ -48,12 +48,14 @@ clean_ds_store_tree() {
if [[ $file_count -gt 0 ]]; then
local size_human
size_human=$(bytes_to_human "$total_bytes")
local size_kb=$(((total_bytes + 1023) / 1024))
if [[ "$DRY_RUN" == "true" ]]; then
echo -e " ${YELLOW}${ICON_DRY_RUN}${NC} $label${NC}, ${YELLOW}$file_count files, $size_human dry${NC}"
else
echo -e " ${GREEN}${ICON_SUCCESS}${NC} $label${NC}, ${GREEN}$file_count files, $size_human${NC}"
local line_color
line_color=$(cleanup_result_color_kb "$size_kb")
echo -e " ${line_color}${ICON_SUCCESS}${NC} $label${NC}, ${line_color}$file_count files, $size_human${NC}"
fi
local size_kb=$(((total_bytes + 1023) / 1024))
files_cleaned=$((files_cleaned + file_count))
total_size_cleaned=$((total_size_cleaned + size_kb))
total_items=$((total_items + 1))