1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-08 05:39:17 +00:00
Commit Graph

1580 Commits

Author SHA1 Message Date
tw93
9b25260efe test(uninstall): fix regex assertions for shellcheck SC2076 2026-02-07 12:32:02 +08:00
tw93
ce65d95522 Merge branch 'main' of https://github.com/tw93/Mole 2026-02-07 11:21:57 +08:00
tw93
361d0dda05 fix: P1/P2 issues in file ops, menu state, and logging
- Fix safe_sudo_remove early exit on error (P1)
- Fix menu filter state leakage in paginated menu (P2)
- Fix cleanup of MOLE_MENU_FILTER_NAMES in app selector (P2)
- Correct log_operation signature for memory dumps (P2)
- Apply minor formatting fixes to dev cleanup module
2026-02-07 11:21:37 +08:00
Tw93
fa8f7a80d9 chore: auto format code 2026-02-07 03:18:32 +00:00
tw93
6f8f16ce48 optimize Xcode simulator cleanup feedback/count (#418) 2026-02-07 11:17:07 +08:00
tw93
95b3818da8 fix(analyze): fix scan deadlock with non-blocking fallback and add regression test (#419) 2026-02-07 11:01:00 +08:00
tw93
5cdfcf2479 fix(uninstall): detect Maestro Studio .mobiledev and add regression test (#421) 2026-02-07 10:44:10 +08:00
tw93
500ab2f568 fix(uninstall): detect Zed HTTPStorages channel variants (#422) 2026-02-07 10:38:17 +08:00
tw93
1990b42524 Merge branch 'main' of https://github.com/tw93/Mole 2026-02-07 10:31:18 +08:00
tw93
a2afb786af fix(ui): standardize spacing in terminal control functions and improve readability 2026-02-07 10:31:15 +08:00
Tw93
0ac3d6cfbb chore: auto format code 2026-02-07 02:30:43 +00:00
tw93
02843dee74 feat(ui): add Ctrl+U support and optimize paginated menu performance 2026-02-07 10:28:41 +08:00
tw93
f3b288a21b feat(uninstall): implement metadata caching for faster app scanning 2026-02-07 10:26:53 +08:00
tw93
337f526021 fix(uninstall): fix error in batch uninstallation logic 2026-02-07 10:26:53 +08:00
Tw93
d2de32f2fe chore: auto format code 2026-02-05 11:52:43 +00:00
tw93
30777dafa3 fix(ui): stop treating space as search filter in paginated menu 2026-02-05 19:50:16 +08:00
tw93
a0d5b476d3 fix(analyze): skip virtualization/container mounts to prevent NFS hangs
- Add OrbStack, Colima, Parallels, VMware Fusion, VirtualBox, Rancher Desktop to skip list
- Prevent infinite NFS timeout loops when scanning VM/container mount points
- Fixes #416
2026-02-05 11:40:00 +08:00
tw93
dfa586d951 fix(raycast): use correct macOS launch method for Ghostty (#415)
Ghostty CLI on macOS cannot launch terminal windows, causing cli:N field parse errors. Use `open -na Ghostty --args -e` instead.
2026-02-05 11:33:19 +08:00
tw93
c5073ec6c8 fix(setup): improve command escaping for Raycast scripts 2026-02-04 20:46:28 +08:00
tw93
382729070d Merge branch 'main' of https://github.com/tw93/Mole 2026-02-04 20:06:59 +08:00
tw93
7f787b5c04 fix: implement MO_USE_FIND and improve fd fallback logic
Fixes the issue reported in PR #410 where mo purge fails to find
artifacts when fd returns empty results.

Changes:
- Implement MO_USE_FIND environment variable to force using find
- Improve fd fallback: check if fd output is empty (-s test)
- Add debug logging to show which tool is being used
- If fd returns no results, fallback to find automatically

This fixes the root cause where fd successfully runs (exit 0) but
finds nothing, preventing the find fallback from being triggered.
2026-02-04 20:05:09 +08:00
tw93
dc2f061d69 fix(raycast): quote raw command safely 2026-02-04 20:01:35 +08:00
tw93
d8b396533d fix: implement MO_USE_FIND and improve fd fallback logic
Fixes the issue reported in PR #410 where `mo purge` fails to find
artifacts when `fd` returns empty results.

Changes:
- Implement MO_USE_FIND environment variable to force using find
- Improve fd fallback: check if fd output is empty (-s test)
- Add debug logging to show which tool is being used
- If fd returns no results, fallback to find automatically

This fixes the root cause where fd successfully runs (exit 0) but
finds nothing, preventing the find fallback from being triggered.
2026-02-04 19:57:44 +08:00
Andrei Murariu
257c639541 bug-fix: add hardcoded directories for raycast removal (#414)
* bug-fix: uninstall raycast leftovers

* bug-fix: add hardcoded directories for raycast removal

---------

Co-authored-by: tw93 <tw93@qq.com>
2026-02-04 19:08:54 +08:00
tw93
cb19899eaa fix(apps): correct array initialization for matches in clean_orphaned_app_data 2026-02-04 17:34:04 +08:00
tw93
8861fe6b5f chore(raycast): prompt before continuing 2026-02-04 16:58:39 +08:00
tw93
ba1a21f8e7 chore(raycast): add explicit script dir steps 2026-02-04 16:54:59 +08:00
tw93
9a6427408e chore(raycast): make setup manual 2026-02-04 16:48:15 +08:00
tw93
5edddb616b chore(raycast): clarify settings open fallback 2026-02-04 16:43:07 +08:00
tw93
8bf3d419f5 fix(raycast): defer command interpolation 2026-02-04 16:39:02 +08:00
tw93
41a26204fb perf: skip redundant -name parameter when pattern is wildcard
Optimization:
- Skip -name "*" in safe_sudo_find_delete when pattern matches everything
- Reduces unnecessary parameter passing to find command
- Improves performance for operations that scan all files

Rationale:
- find -name "*" is redundant as it matches everything by default
- Removing it reduces command overhead without changing behavior
2026-02-04 16:18:13 +08:00
tw93
0fbf2661c8 perf: optimize system cleanup by merging find operations
Performance improvements:
- Merge 3 separate find operations into 1 for /Library/Caches
  - Combine *.cache, *.tmp, *.log patterns in single scan
  - Reduces filesystem traversal overhead
- Merge 2 find operations into 1 for /private/var/log
  - Combine *.log and *.gz patterns
- Optimize diagnostics cleanup with single combined scan
  - Merge Special, Persist, and tracev3 patterns
  - Reduces redundant directory traversal
- Use find -delete for batch removal of memory exception reports
  - More efficient than iterative removal for large file counts
  - Add summary logging to operations.log

UI improvements:
- Add granular spinner messages for each cleanup stage
- Separate diagnostic logs and power logs output for clarity
- Add progress feedback during Time Machine status check

Tests:
- Update sudo mock functions to support new combined find patterns
- Verify find -delete usage for memory exception cleanup
- Update assertions to match optimized implementation
2026-02-04 16:18:06 +08:00
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
0fb4d32bb6 fix: improve whitelist pattern validation in cleanup tests 2026-02-03 20:53:21 +08:00
tw93
579c963940 uninstall: refine protection flow and menu filtering 2026-02-03 17:36:15 +08:00
tw93
bad1c71231 fix: protect Gradle cache from cleanup by default
Gradle build cache (~/.gradle/caches) is now protected by default whitelist,
similar to Maven repository. This prevents unintentional deletion of large
dependency caches that take time and bandwidth to re-download.

- Add ~/.gradle/caches/* and ~/.gradle/daemon/* to DEFAULT_WHITELIST_PATTERNS
- Remove Gradle cleanup from clean_dev_jvm() function
- Users can disable protection via 'mo clean --whitelist' if needed

Fixes #408
2026-02-03 16:37:33 +08:00
tw93
d3206354f6 docs: add Raycast setup instructions to README for better user guidance 2026-02-03 15:09:06 +08:00
tw93
a5c7abd227 refactor: optimize raycast cleanup code structure
Improve code readability and maintainability:
- Simplify conditional logic with chained operators
- Add clarifying comments for different cleanup scopes
- Rename variables for better semantic clarity
- Maintain consistent style with other app cleanup patterns
2026-02-03 14:53:10 +08:00
Andrei Murariu
4f3eb0eb62 bug-fix: uninstall raycast leftovers (#404) 2026-02-03 14:47:44 +08:00
dependabot[bot]
7133ea4966 chore(deps): bump github.com/shirou/gopsutil/v4 from 4.25.12 to 4.26.1 (#406)
Bumps [github.com/shirou/gopsutil/v4](https://github.com/shirou/gopsutil) from 4.25.12 to 4.26.1.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v4.25.12...v4.26.1)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v4
  dependency-version: 4.26.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-03 14:46:14 +08:00
dependabot[bot]
09ae5ee3eb chore(deps): bump actions/cache from 5.0.2 to 5.0.3 (#405)
Bumps [actions/cache](https://github.com/actions/cache) from 5.0.2 to 5.0.3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](8b402f58fb...cdf6c1fa76)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-version: 5.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-03 14:46:04 +08:00
tw93
c6e58c4ead fix: replace clear with clear_screen for better clarity in main function 2026-02-02 17:38:29 +08:00
tw93
d02bb49497 fix: update macOS installer cleanup logic to remove installers older than 14 days 2026-02-02 17:28:57 +08:00
tw93
5f88d84d3f fix: update authentication failure messages for clarity 2026-02-02 17:18:32 +08:00
tw93
48db04a95b fix: add comment for clarity in safe_sudo_remove function 2026-02-02 17:15:32 +08:00
github-actions[bot]
34bbf82b96 chore: update contributors [skip ci] 2026-02-02 09:06:34 +00:00
tw93
05faf2b691 core: improve file removal diagnostics 2026-02-02 17:06:00 +08:00
tw93
f965ca25c3 uninstall: harden cache and removal flow 2026-02-02 17:05:42 +08:00
tw93
aaa3a6ae5a ui: add menu filtering support 2026-02-02 17:05:19 +08:00
Andrei Murariu
e8f46a7a1c feat: Homebrew uninstall with --zap flag (#397)
Uninstalling mole with Zap will automatically remove also the directories that brew creates for it. -> More complete uninstallation

Also updated the test about uninstalling
2026-02-02 11:26:58 +08:00