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

Optimize test reading version

This commit is contained in:
Tw93
2025-10-13 14:33:06 +08:00
parent db3b033fc0
commit 098d54b055
3 changed files with 21 additions and 12 deletions

View File

@@ -60,6 +60,7 @@ EOF
get_all_cache_items() {
# Format: "display_name|pattern|category"
cat << 'EOF'
Apple Mail cache|$HOME/Library/Caches/com.apple.mail/*|system_cache
Gradle build cache (Android Studio, Gradle projects)|$HOME/.gradle/caches/*|ide_cache
Gradle daemon processes cache|$HOME/.gradle/daemon/*|ide_cache
Xcode DerivedData (build outputs, indexes)|$HOME/Library/Developer/Xcode/DerivedData/*|ide_cache
@@ -159,10 +160,9 @@ is_whitelisted() {
for existing in "${CURRENT_WHITELIST_PATTERNS[@]}"; do
local existing_expanded="${existing/#\~/$HOME}"
if [[ "$check_pattern" == "$existing_expanded" ]]; then
return 0
fi
if [[ "$check_pattern" == "$existing_expanded" ]]; then
# Support both exact match and glob pattern match
# shellcheck disable=SC2053
if [[ "$check_pattern" == "$existing_expanded" ]] || [[ $check_pattern == $existing_expanded ]]; then
return 0
fi
done