mirror of
https://github.com/tw93/Mole.git
synced 2026-02-15 18:40:05 +00:00
Do not clean up the system panel cache
This commit is contained in:
11
bin/clean.sh
11
bin/clean.sh
@@ -230,6 +230,17 @@ safe_clean() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
# Protect system app containers from accidental cleanup
|
||||||
|
# Extract bundle ID from ~/Library/Containers/<bundle_id>/... paths
|
||||||
|
if [[ "$path" == */Library/Containers/* ]] && [[ "$path" =~ /Library/Containers/([^/]+)/ ]]; then
|
||||||
|
local container_bundle_id="${BASH_REMATCH[1]}"
|
||||||
|
if should_protect_data "$container_bundle_id"; then
|
||||||
|
debug_log "Protecting system container: $container_bundle_id"
|
||||||
|
skip=true
|
||||||
|
((skipped_count++))
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
[[ "$skip" == "true" ]] && continue
|
[[ "$skip" == "true" ]] && continue
|
||||||
|
|
||||||
# Check user-defined whitelist
|
# Check user-defined whitelist
|
||||||
|
|||||||
@@ -1800,10 +1800,11 @@ bundle_matches_pattern() {
|
|||||||
|
|
||||||
[[ -z "$pattern" ]] && return 1
|
[[ -z "$pattern" ]] && return 1
|
||||||
|
|
||||||
# shellcheck disable=SC2254 # allow glob pattern matching for bundle rules
|
# Use bash [[ ]] for glob pattern matching (works with variables in bash 3.2+)
|
||||||
case "$bundle_id" in
|
# shellcheck disable=SC2053 # allow glob pattern matching
|
||||||
$pattern) return 0 ;;
|
if [[ "$bundle_id" == $pattern ]]; then
|
||||||
esac
|
return 0
|
||||||
|
fi
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user