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

Continue to fix the exit issue

This commit is contained in:
Tw93
2025-12-06 09:17:58 +08:00
parent 6272aa5bb5
commit c2abb639dc
8 changed files with 66 additions and 147 deletions

View File

@@ -47,7 +47,7 @@ clean_broken_preferences() {
((broken_count++))
((total_size_kb += size_kb))
done < <(command find "$prefs_dir" -maxdepth 1 -name "*.plist" -type f 2> /dev/null || true)
done < <(run_with_timeout 10 sh -c "find '$prefs_dir' -maxdepth 1 -name '*.plist' -type f 2> /dev/null || true")
# Check ByHost preferences with timeout protection
local byhost_dir="$prefs_dir/ByHost"
@@ -66,13 +66,13 @@ clean_broken_preferences() {
plutil -lint "$plist_file" > /dev/null 2>&1 && continue
local size_kb
size_kb=$(get_path_size_kb "$plist_file")
size_kb=$(run_with_timeout 5 get_path_size_kb "$plist_file")
[[ "$DRY_RUN" != "true" ]] && rm -f "$plist_file" 2> /dev/null || true
((broken_count++))
((total_size_kb += size_kb))
done < <(command find "$byhost_dir" -name "*.plist" -type f 2> /dev/null || true)
done < <(run_with_timeout 10 sh -c "find '$byhost_dir' -name '*.plist' -type f 2> /dev/null || true")
fi
if [[ -t 1 ]]; then
@@ -148,7 +148,7 @@ clean_broken_login_items() {
((broken_count++))
((total_size_kb += size_kb))
done < <(command find "$launch_agents_dir" -name "*.plist" -type f 2> /dev/null || true)
done < <(run_with_timeout 10 sh -c "find '$launch_agents_dir' -name '*.plist' -type f 2> /dev/null || true")
if [[ -t 1 ]]; then
stop_inline_spinner