1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 15:04:42 +00:00

🎨 Loading optimization and better use of links

This commit is contained in:
Tw93
2025-10-08 18:01:46 +08:00
parent 79b1ea4091
commit 1657ff584b
9 changed files with 623 additions and 308 deletions

View File

@@ -42,15 +42,15 @@ collect_files_to_be_cleaned() {
local clean_sh="$SCRIPT_DIR/../bin/clean.sh"
local -a items=()
echo -e "${BLUE}${NC} Scanning cache files..."
echo -e "${BLUE}|${NC} Scanning cache files..."
echo ""
# Run clean.sh in dry-run mode
local temp_output=$(mktemp)
local temp_output=$(create_temp_file)
echo "" | bash "$clean_sh" --dry-run 2>&1 > "$temp_output" || true
# Strip ANSI color codes for parsing
local temp_plain=$(mktemp)
local temp_plain=$(create_temp_file)
sed $'s/\033\[[0-9;]*m//g' "$temp_output" > "$temp_plain"
# Parse output: " → Description (size, dry)"
@@ -83,7 +83,7 @@ collect_files_to_be_cleaned() {
fi
done < "$temp_plain"
rm -f "$temp_output" "$temp_plain"
# Temp files will be auto-cleaned by cleanup_temp_files
# Return early if no items found
if [[ ${#items[@]} -eq 0 ]]; then