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

fix: clean update packages with SIP enabled

This commit is contained in:
Tw93
2026-01-22 16:16:50 +08:00
parent cd367b67b9
commit 8188f4b81b

View File

@@ -19,7 +19,6 @@ clean_deep_system() {
safe_sudo_find_delete "/private/var/log" "*.gz" "$MOLE_LOG_AGE_DAYS" "f" || true
log_success "System logs"
if [[ -d "/Library/Updates" && ! -L "/Library/Updates" ]]; then
if ! is_sip_enabled; then
local updates_cleaned=0
while IFS= read -r -d '' item; do
if [[ -z "$item" ]] || [[ ! "$item" =~ ^/Library/Updates/[^/]+$ ]]; then
@@ -37,7 +36,6 @@ clean_deep_system() {
done < <(find /Library/Updates -mindepth 1 -maxdepth 1 -print0 2> /dev/null || true)
[[ $updates_cleaned -gt 0 ]] && log_success "System library updates"
fi
fi
if [[ -d "/macOS Install Data" ]]; then
local mtime=$(get_file_mtime "/macOS Install Data")
local age_days=$((($(get_epoch_seconds) - mtime) / 86400))