diff --git a/cmd/analyze/cleanable.go b/cmd/analyze/cleanable.go index e7140da..f98b3f9 100644 --- a/cmd/analyze/cleanable.go +++ b/cmd/analyze/cleanable.go @@ -37,7 +37,6 @@ func isHandledByMoClean(path string) bool { "/Library/Logs/", "/Library/Saved Application State/", "/.Trash/", - "/Library/Application Support/CrashReporter/", "/Library/DiagnosticReports/", } diff --git a/lib/clean_system.sh b/lib/clean_system.sh index 64aaeed..5297eb9 100644 --- a/lib/clean_system.sh +++ b/lib/clean_system.sh @@ -27,7 +27,6 @@ clean_deep_system() { # Clean crash reports safe_sudo_find_delete "/Library/Logs/DiagnosticReports" "*" "$MOLE_CRASH_REPORT_AGE_DAYS" "f" - safe_sudo_find_delete "/Library/Logs/CrashReporter" "*" "$MOLE_CRASH_REPORT_AGE_DAYS" "f" log_success "Old system crash reports (${MOLE_CRASH_REPORT_AGE_DAYS}+ days)" # Clean system logs diff --git a/lib/clean_user_data.sh b/lib/clean_user_data.sh index f64b031..a018e06 100644 --- a/lib/clean_user_data.sh +++ b/lib/clean_user_data.sh @@ -32,7 +32,6 @@ clean_user_essentials() { done fi - safe_clean ~/Library/Application\ Support/CrashReporter/* "Crash reports" safe_clean ~/Library/DiagnosticReports/* "Diagnostic reports" safe_clean ~/Library/Caches/com.apple.QuickLook.thumbnailcache "QuickLook thumbnails" safe_clean ~/Library/Caches/Quick\ Look/* "QuickLook cache" diff --git a/lib/common.sh b/lib/common.sh index d360331..6a471a4 100755 --- a/lib/common.sh +++ b/lib/common.sh @@ -180,9 +180,9 @@ safe_find_delete() { local type_filter="${4:-f}" # Validate base directory exists and is not a symlink + # Silently skip if directory does not exist (e.g., old macOS paths) if [[ ! -d "$base_dir" ]]; then - log_warning "Base directory does not exist: $base_dir" - return 1 + return 0 fi if [[ -L "$base_dir" ]]; then @@ -216,9 +216,9 @@ safe_sudo_find_delete() { local type_filter="${4:-f}" # Validate base directory exists and is not a symlink + # Silently skip if directory does not exist (e.g., old macOS paths) if [[ ! -d "$base_dir" ]]; then - log_warning "Base directory does not exist: $base_dir" - return 1 + return 0 fi if [[ -L "$base_dir" ]]; then @@ -1745,9 +1745,6 @@ find_app_files() { while IFS= read -r -d '' report; do files_to_clean+=("$report") done < <(find ~/Library/Logs/DiagnosticReports \( -name "*$app_name*" -o -name "*$bundle_id*" \) -print0 2> /dev/null) - while IFS= read -r -d '' report; do - files_to_clean+=("$report") - done < <(find ~/Library/Logs/CrashReporter \( -name "*$app_name*" -o -name "*$bundle_id*" \) -print0 2> /dev/null) # Saved Application State [[ -d ~/Library/Saved\ Application\ State/"$bundle_id".savedState ]] && files_to_clean+=("$HOME/Library/Saved Application State/$bundle_id.savedState") @@ -1937,9 +1934,6 @@ find_app_system_files() { while IFS= read -r -d '' report; do system_files+=("$report") done < <(find /Library/Logs/DiagnosticReports \( -name "*$app_name*" -o -name "*$bundle_id*" \) -print0 2> /dev/null) - while IFS= read -r -d '' report; do - system_files+=("$report") - done < <(find /Library/Logs/CrashReporter \( -name "*$app_name*" -o -name "*$bundle_id*" \) -print0 2> /dev/null) # System Frameworks [[ -d /Library/Frameworks/"$app_name".framework ]] && system_files+=("/Library/Frameworks/$app_name.framework") diff --git a/lib/optimization_tasks.sh b/lib/optimization_tasks.sh index 9e4202a..14a2fe7 100644 --- a/lib/optimization_tasks.sh +++ b/lib/optimization_tasks.sh @@ -134,7 +134,6 @@ opt_log_cleanup() { echo -e "${BLUE}${ICON_ARROW}${NC} Clearing diagnostic & crash logs..." local -a user_logs=( "$HOME/Library/Logs/DiagnosticReports" - "$HOME/Library/Logs/CrashReporter" "$HOME/Library/Logs/corecaptured" ) for target in "${user_logs[@]}"; do