mirror of
https://github.com/tw93/Mole.git
synced 2026-02-15 00:35:07 +00:00
remove old CrashReporter
This commit is contained in:
@@ -37,7 +37,6 @@ func isHandledByMoClean(path string) bool {
|
|||||||
"/Library/Logs/",
|
"/Library/Logs/",
|
||||||
"/Library/Saved Application State/",
|
"/Library/Saved Application State/",
|
||||||
"/.Trash/",
|
"/.Trash/",
|
||||||
"/Library/Application Support/CrashReporter/",
|
|
||||||
"/Library/DiagnosticReports/",
|
"/Library/DiagnosticReports/",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ clean_deep_system() {
|
|||||||
|
|
||||||
# Clean crash reports
|
# Clean crash reports
|
||||||
safe_sudo_find_delete "/Library/Logs/DiagnosticReports" "*" "$MOLE_CRASH_REPORT_AGE_DAYS" "f"
|
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)"
|
log_success "Old system crash reports (${MOLE_CRASH_REPORT_AGE_DAYS}+ days)"
|
||||||
|
|
||||||
# Clean system logs
|
# Clean system logs
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ clean_user_essentials() {
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
safe_clean ~/Library/Application\ Support/CrashReporter/* "Crash reports"
|
|
||||||
safe_clean ~/Library/DiagnosticReports/* "Diagnostic reports"
|
safe_clean ~/Library/DiagnosticReports/* "Diagnostic reports"
|
||||||
safe_clean ~/Library/Caches/com.apple.QuickLook.thumbnailcache "QuickLook thumbnails"
|
safe_clean ~/Library/Caches/com.apple.QuickLook.thumbnailcache "QuickLook thumbnails"
|
||||||
safe_clean ~/Library/Caches/Quick\ Look/* "QuickLook cache"
|
safe_clean ~/Library/Caches/Quick\ Look/* "QuickLook cache"
|
||||||
|
|||||||
@@ -180,9 +180,9 @@ safe_find_delete() {
|
|||||||
local type_filter="${4:-f}"
|
local type_filter="${4:-f}"
|
||||||
|
|
||||||
# Validate base directory exists and is not a symlink
|
# 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
|
if [[ ! -d "$base_dir" ]]; then
|
||||||
log_warning "Base directory does not exist: $base_dir"
|
return 0
|
||||||
return 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -L "$base_dir" ]]; then
|
if [[ -L "$base_dir" ]]; then
|
||||||
@@ -216,9 +216,9 @@ safe_sudo_find_delete() {
|
|||||||
local type_filter="${4:-f}"
|
local type_filter="${4:-f}"
|
||||||
|
|
||||||
# Validate base directory exists and is not a symlink
|
# 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
|
if [[ ! -d "$base_dir" ]]; then
|
||||||
log_warning "Base directory does not exist: $base_dir"
|
return 0
|
||||||
return 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -L "$base_dir" ]]; then
|
if [[ -L "$base_dir" ]]; then
|
||||||
@@ -1745,9 +1745,6 @@ find_app_files() {
|
|||||||
while IFS= read -r -d '' report; do
|
while IFS= read -r -d '' report; do
|
||||||
files_to_clean+=("$report")
|
files_to_clean+=("$report")
|
||||||
done < <(find ~/Library/Logs/DiagnosticReports \( -name "*$app_name*" -o -name "*$bundle_id*" \) -print0 2> /dev/null)
|
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
|
# Saved Application State
|
||||||
[[ -d ~/Library/Saved\ Application\ State/"$bundle_id".savedState ]] && files_to_clean+=("$HOME/Library/Saved Application State/$bundle_id.savedState")
|
[[ -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
|
while IFS= read -r -d '' report; do
|
||||||
system_files+=("$report")
|
system_files+=("$report")
|
||||||
done < <(find /Library/Logs/DiagnosticReports \( -name "*$app_name*" -o -name "*$bundle_id*" \) -print0 2> /dev/null)
|
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
|
# System Frameworks
|
||||||
[[ -d /Library/Frameworks/"$app_name".framework ]] && system_files+=("/Library/Frameworks/$app_name.framework")
|
[[ -d /Library/Frameworks/"$app_name".framework ]] && system_files+=("/Library/Frameworks/$app_name.framework")
|
||||||
|
|||||||
@@ -134,7 +134,6 @@ opt_log_cleanup() {
|
|||||||
echo -e "${BLUE}${ICON_ARROW}${NC} Clearing diagnostic & crash logs..."
|
echo -e "${BLUE}${ICON_ARROW}${NC} Clearing diagnostic & crash logs..."
|
||||||
local -a user_logs=(
|
local -a user_logs=(
|
||||||
"$HOME/Library/Logs/DiagnosticReports"
|
"$HOME/Library/Logs/DiagnosticReports"
|
||||||
"$HOME/Library/Logs/CrashReporter"
|
|
||||||
"$HOME/Library/Logs/corecaptured"
|
"$HOME/Library/Logs/corecaptured"
|
||||||
)
|
)
|
||||||
for target in "${user_logs[@]}"; do
|
for target in "${user_logs[@]}"; do
|
||||||
|
|||||||
Reference in New Issue
Block a user