1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 16:49:41 +00:00
Commit Graph

525 Commits

Author SHA1 Message Date
Tw93
c34d91b36f feat: enhance uninstall with launch items and login items cleanup
- Add automatic cleanup of LaunchAgents/Daemons (Issue #315)
- Support both system and user-level launch paths
- Add Login Items cleanup (fixing broken entries like CodexBar)
- Improve Homebrew uninstall logging visibility
- Update security audit and tests
2026-01-15 11:39:33 +08:00
Tw93
cac2909093 fix: prevent Microsoft Teams from being misdetected as Edge
Fixes #313

Change browser process detection from pgrep -f (full command line match)
to pgrep -x (exact process name match) to prevent false positives.

Microsoft Teams processes contain 'Microsoft' in their paths and may have
Chromium-based components, which was causing them to be incorrectly
identified as Microsoft Edge during clean operations.

Changes:
- Chrome detection: pgrep -f → pgrep -x
- Edge detection: pgrep -f → pgrep -x
- Edge updater detection: pgrep -f → pgrep -x

This approach is consistent with Firefox detection and prevents Apps like
Microsoft Teams, Microsoft Office, or other Microsoft products from
triggering false Edge detection.

All existing tests pass (9/9 in clean_browser_versions.bats).
2026-01-15 09:51:56 +08:00
Jack Phallen
9f441eea86 Fix unrelated test failures
Fixed WHITELIST_PATTERNS unbound variable error in lib/core/app_protection.sh
Updated clean_empty_library_items to match current behavior
2026-01-14 09:29:05 -05:00
Jack Phallen
d884a268e8 fix(uninstall): Harden brew uninstall 2026-01-14 09:17:41 -05:00
Tw93
d0faaa33c6 chore: auto format code 2026-01-14 06:10:25 +00:00
Tw93
62cfafd7da Tighten dock removal and add brew uninstall fallback 2026-01-14 14:09:08 +08:00
Tw93
572c5c7b3b chore: auto format code 2026-01-14 05:01:12 +00:00
Tw93
a800e9e48f Merge branch 'main' of github.com:tw93/Mole 2026-01-14 12:56:54 +08:00
Tw93
8a873c85a3 fix: remove unsafe file cleanup in Library root and fix tests
- lib/clean: remove empty file cleanup in ~/Library to protect potential sentinel files
- tests: fix unbound variable error in clean_user_core.bats by initializing WHITELIST_PATTERNS
2026-01-14 12:56:38 +08:00
Tw93
00a712711e chore: auto format code 2026-01-14 03:59:21 +00:00
Tw93
0a632c0a22 fix: protect Firefox browser data from cleaning
Fixes #307

- Add Firefox to DATA_PROTECTED_BUNDLES to prevent cleaning
- Protects IndexedDB, localStorage, and other complex storage
- Prevents Gmail and other web apps from breaking after clean
2026-01-14 11:26:24 +08:00
Tw93
c210aad3a3 Merge branch 'dev' into dev 2026-01-14 10:18:21 +08:00
Tw93
83dc59bb54 feat: improve purge display with full paths and size sorting (#311)
- Show full project paths (~/www/project) instead of just project names
  - Sort artifacts by size descending (largest first)
  - Increase path display width for better readability
  - Support CMD+Click to open folders in terminal
2026-01-14 10:15:58 +08:00
Tw93
7360f0a59e feat: Implement empty file cleanup in ~/Library root (#234)
- Add logic to remove 0-byte files in ~/Library (maxdepth 1)
- Explicitly protect .localized files to preserve Finder localization
- Respect global whitelist patterns
2026-01-14 09:49:47 +08:00
Copper-Eye
fae1c88fa2 add cpu temp display and optimize user check 2026-01-13 17:21:03 -04:00
Tw93
421cdd09dc feat: enhance safe cache cleaning for Electron apps and VS Code
- Add safe cleanup for Antigravity, Filo, and Claude caches in Application Support (Cache, GPUCache, Code Cache only).
- Enhance VS Code cleanup to include deep rendering caches (GPU, Dawn) and extension installers.
- Validated to ensure no user data or pnpm/yarn executables are touched.
2026-01-13 19:04:54 +08:00
Tw93
8ec7663a70 Fixed the ShellCheck warning 2026-01-13 16:54:10 +08:00
Tw93
0bd30955a2 feat: detect multiple NDK and Rust toolchain versions (#234)
Add report-only detection for multiple Android NDK and Rust toolchain
installations. Users receive helpful guidance for manual cleanup via
Android Studio SDK Manager or rustup commands.

- Add check_android_ndk() and check_rust_toolchains()
- Extract check_multiple_versions() helper (DRY)
- Add 4 test cases, optimize test performance
- Fix shellcheck warnings

All 393 tests passing.
2026-01-13 15:59:43 +08:00
Tw93
5b51007c3f Fix mo purge UI glitch by correctly clearing the scanning progress line without overwriting the title. 2026-01-13 14:16:41 +08:00
Tw93
3c8c2b3b98 chore: auto format code 2026-01-13 02:45:33 +00:00
Tw93
6b594c7d69 feat: add Homebrew integration and optimize UI performance
- Add Homebrew cask detection and use 'brew uninstall --cask' for proper cleanup
  - Add real-time progress feedback during uninstallation
  - Optimize scroll performance by only redrawing visible items
  - Replace Python-based Dock removal with PlistBuddy for better compatibility
  - Add comprehensive tests for Homebrew functionality

  Fixes #306
2026-01-13 10:44:48 +08:00
Tw93
8bd2bac580 Merge branch 'dev' 2026-01-12 17:50:07 +08:00
Tw93
5d77001a72 Optimize the effect and speed of scanning 2026-01-12 17:49:51 +08:00
Tw93
93dee7b94d Implemented safer temp cleanup and error reporting while fixing folded-directory size fallback to prevent double counting and aligning Homebrew cleanup traps with safe removal. 2026-01-12 15:45:31 +08:00
Tw93
5d5056fc9e fix: address mo update hanging and imporve temporary file reliability 2026-01-12 14:55:42 +08:00
Tw93
1a40875b80 refactor: improve code quality and test coverage
This commit addresses several code quality issues identified in the
recent bash 3.2 compatibility fixes:

1. Remove redundant array length check in is_whitelisted()
   - The second check for array length > 0 is unnecessary after
     already checking for length == 0

2. Clean up commented dangerous cleanup code in dev.sh
   - Replace commented-out code with clear documentation
   - Add explicit notes explaining why certain paths are excluded
   - Improves maintainability by preventing confusion

3. Enhance test coverage for excluded paths
   - Add tests to verify Mix archives are NOT cleaned
   - Add tests to verify Stack programs are NOT cleaned
   - Add tests to verify VS Code workspace storage is NOT cleaned
   - These tests ensure critical data remains protected

All changes pass ShellCheck, syntax validation, and formatting checks.
2026-01-12 10:09:02 +08:00
Jack Phallen
a994e9b406 fix: remove Time Machine mount check 2026-01-11 09:58:43 -05:00
Tw93
35234ff194 chore: auto format code 2026-01-11 02:04:05 +00:00
Tw93
84bf540c1c fix: safeguard empty array iterations for bash 3.2 compatibility 2026-01-11 10:03:12 +08:00
Tw93
54be4e30a2 fix: global optimization for safe_clean and doc update 2026-01-11 09:55:18 +08:00
Tw93
74fc3df455 Merge branch 'pr-287' into dev 2026-01-11 09:27:15 +08:00
Tw93
413b2c8f98 fix: disable aggressive cleanup and optimize directory checks 2026-01-11 09:27:12 +08:00
Jack Phallen
c0f76936cd feat: Skip TimeMachine cleaning if running 2026-01-10 17:40:42 -05:00
Tw93
8118cab604 Merge branch 'main' of github.com:tw93/Mole 2026-01-10 08:52:12 +08:00
Tw93
273a6b5cf0 fix(clean): enhance orphan detection accuracy and safety
- Expand app scan to include Homebrew Cask and Setapp locations
- Add lsappinfo fallback for more reliable running app detection
- Add sensitive data protection patterns (1Password, Keychain, etc.)
- Add mdfind fallback with file-based caching (Bash 3.2 compatible)
2026-01-10 08:51:14 +08:00
Tw93
9c39eef7fe chore: auto format code 2026-01-10 00:23:16 +00:00
Tw93
0a654f365b fix(clean): enhance orphan detection accuracy and safety
- Expand app scan to include Homebrew Cask and Setapp locations
- Add lsappinfo fallback for more reliable running app detection
- Add sensitive data protection patterns (1Password, Keychain, etc.)
- Add mdfind fallback with file-based caching (Bash 3.2 compatible)
2026-01-10 08:22:17 +08:00
biplavbarua
096c0ca73f feat: add cleanup support for Elixir, Haskell, OCaml, and Editors 2026-01-10 01:22:43 +05:30
Biplav Barua
3507870275 feat: add Angular, SvelteKit, Astro, and coverage to purge targets (#286) 2026-01-10 00:05:38 +08:00
Tw93
ce8989d3e9 chore: auto format code 2026-01-09 06:44:51 +00:00
Tw93
e33e428569 fix: add KeePassXC new bundle id to protection list (#285) 2026-01-09 14:43:50 +08:00
Tw93
24fa0f8f21 feat: Add cleanup rule for Quark (夸克) video cache (#279) 2026-01-09 14:38:59 +08:00
Tw93
2394c5d768 feat(touchid): add sudo_local support with silent migration 2026-01-09 11:02:10 +08:00
Tw93
9a3ecb7377 Merge branch 'dev' 2026-01-08 11:37:36 +08:00
Tw93
7d6d5eb8b0 Fix the issue with the IDE GoLang cache #269 2026-01-08 10:20:04 +08:00
Tw93
1fccf6bcf8 Repair brew update prompts 2026-01-08 10:16:58 +08:00
Tw93
d3f1cdd834 fix(security): allow Firefox ..files directories in path validation
Fixes #263

- Change regex from \.\. to (^|/)\.\.(/|$) to only match path components
- Firefox uses ..files suffix in IndexedDB dirs (e.g., name..files)
- Still blocks actual traversal: /tmp/../etc
- Added test cases for Firefox compatibility
- All 16 tests passing
2026-01-06 09:51:34 +08:00
Tw93
33a77fecef Merge pull request #254 from JackPhallen/chore/remove-unnecessary-command-check
chore: Do not check if should_protect_path exists
2026-01-05 14:54:27 +08:00
Jack Phallen
f21a1339a7 chore: Do not check if should_protect_path exists
should_protect_path will always be available as it comes from common.sh.
This check adds a lot of overhead as it runs on every file.
2026-01-04 21:33:39 -05:00
Tw93
07ea303105 feat: enhance optimization summary with specific metrics for cleaned cache, repaired configs, and optimized databases 2026-01-05 00:26:08 +08:00