1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 18:34:46 +00:00
Commit Graph

4 Commits

Author SHA1 Message Date
tw93
a4e084a4ed feat: improve app cleanup with orphaned LaunchAgent detection
New features:
- Add orphaned LaunchAgent/LaunchDaemon detection with 5-layer verification
  - Layer 1: Check if program path exists
  - Layer 2: Verify AssociatedBundleIdentifiers via mdfind
  - Layer 3: Check Application Support directory activity (7 days)
  - Layer 4: Fuzzy match app name in /Applications
  - Layer 5: Special handling for PrivilegedHelperTools
- Only process user-level ~/Library/LaunchAgents (safer than system-level)
- Unload agent before removal using launchctl

Bug fixes:
- Handle paths with spaces correctly in orphaned_app_data cleanup
  - Add nullglob state management to prevent word splitting
  - Use IFS=$'\n' for proper array iteration
- Only count successful deletions (check safe_clean return value)

Tests:
- Add 4 new tests for is_launch_item_orphaned edge cases
- Add tests for space handling and deletion count accuracy
2026-02-04 16:17:36 +08:00
Tw93
d7a0d480bc fix: improve dry-run mode and error handling
- Export MOLE_DRY_RUN env var for subprocess visibility
- Add || true to grep commands to prevent pipeline failures
- Add dry-run test for clean_orphaned_system_services
- Simplify clean_local_snapshots tests
2026-01-23 18:05:09 +08:00
Tw93
93953abad6 fix: remove insecure empty folder cleanup logic to prevent critical data loss (#320)
- Removes clean_empty_library_items functionality that incorrectly deleted critical paths (e.g., Postgres data, Steam locks)
- Cleans up associated tests and unnecessary protection rules
- Ensures empty folders are preserved by default for safety
2026-01-15 21:24:38 +08:00
Tw93
3cb21aad7e refactor: improve brew cleanup timeout handling and remove app_caches, clean_extras, and optimize_core tests. 2026-01-03 12:53:31 +08:00