1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 20:15:07 +00:00
Commit Graph

1860 Commits

Author SHA1 Message Date
tw93
1c2796377d docs: refine README copy 2026-02-22 20:46:34 +08:00
tw93
fd5ceea743 feat(clean): expand conservative cache cleanup coverage
- add conservative support/app/system cache targets\n- fix dry-run + success logging behavior for memory exception cleanup\n- add regression tests for new cleanup paths and safeguards\n\nRefs #477
2026-02-22 11:06:48 +08:00
tw93
894c81bb9a fix(purge): detect artifacts when search path is project root 2026-02-22 10:08:20 +08:00
tw93
ec3affe882 chore(clean): reduce noisy clean output messages
- remove redundant project cache scanning line

- align xcode runtime empty result message to already clean
V1.27.0
2026-02-21 23:48:07 +08:00
tw93
37f4a82efa Merge branch 'main' of https://github.com/tw93/Mole 2026-02-21 23:41:48 +08:00
tw93
831aebfc3e docs(security): refresh audit for v1.27.0 cleanup hardening
- document safe deletion flow changes in system/user cleanup

- update timeout reference and latest local security test results
2026-02-21 23:38:41 +08:00
tw93
82366d8c5a test(perf): reduce get_file_size loop count in benchmark
- lower iterations from 100 to 50 to reduce flaky timing noise
2026-02-21 23:36:15 +08:00
tw93
16a8bcafde chore(dev-clean): streamline runtime volume reporting
- reduce noisy scan output outside debug mode

- consolidate final result messaging

- run xcode/code editor stages explicitly in developer flow

- update dev cache tests for new stage calls
2026-02-21 23:36:05 +08:00
tw93
c95a4ec5a8 fix(system): enforce safe sudo cleanup paths
- replace direct delete patterns with safe_sudo_find_delete/safe_sudo_remove

- keep log/temp/diagnostic cleanup behavior with guarded scans

- align system maintenance tests with safe deletion flow
2026-02-21 23:35:58 +08:00
tw93
dc8d1bd948 refactor(clean): merge app cache/user essentials flow
- reorganize perform_cleanup sections and naming

- merge macOS + sandbox caches into clean_app_caches

- move recent items and mail downloads into user essentials

- update core/user tests for renamed internal helpers
2026-02-21 23:35:53 +08:00
github-actions[bot]
6f54103b88 chore: update contributors [skip ci] 2026-02-21 12:23:07 +00:00
tw93
30fe312c22 Merge branch 'main' of https://github.com/tw93/Mole 2026-02-21 20:22:46 +08:00
tw93
e581da1d65 chore(release): bump version to 1.27.0 2026-02-21 20:22:16 +08:00
tw93
ef0e34a214 refactor(clean): optimize Group Containers directory check
- Replace ls with find -maxdepth 1 to reduce IO and permission noise
- Keep same behavior: silently skip if directory is empty or inaccessible

Addresses: user.sh (line 484)
2026-02-21 20:22:06 +08:00
tw93
9440d9e52a fix(dev): normalize npm cache paths and add maven function guard
- Normalize npm cache paths with pwd -P to handle symlinks and
  trailing slashes, preventing duplicate scans of same directory
- Add declare -f check before calling clean_maven_repository for
  robustness when dynamic source fails
- Add test for trailing slash handling

Addresses: dev.sh (line 27, 48, 602)
2026-02-21 20:22:01 +08:00
tw93
0597021fd4 fix(purge): save and restore caller traps to prevent state leak
- Save caller's INT/TERM traps before installing local cleanup trap
- Restore original traps after clean_project_artifacts completes
- Add test to verify trap restoration behavior

Fixes P3 issue: project.sh (line 825, 870)
2026-02-21 20:21:54 +08:00
tw93
7648bd9d12 fix(status): prevent duplicate mole rendering in error state
- renderHeader now returns empty string as second return value when
  error message is present, avoiding duplicate mole in main.go View
- Add unit tests to prevent regression

Fixes P2 issue: view.go (line 184) + main.go (line 160)
2026-02-21 20:21:45 +08:00
Bachrul uluum
0b5066831d Update README with 'fd' installation instructions (#476)
Added recommendation for installing 'fd' on macOS and included cautionary note about artifact deletion.
2026-02-21 18:18:45 +08:00
tw93
68b0b601a4 feat(clean): add Group Containers logs/caches cleanup
Add clean_group_container_caches() to safely clean Group Containers:
- Skip Apple-owned containers (com.apple.*, group.com.apple.*, systemgroup.com.apple.*)
- For protected apps: only clean Logs directories
- For non-protected apps: clean Logs, tmp, and Caches
- Add symlink checks to prevent path traversal
- Respect whitelist and should_protect_path checks
- Integrate with clean_sandboxed_app_caches flow

Also add symlink checks in process_container_cache() for consistency.

Includes 4 BATS tests covering protected apps, whitelist,
system containers, and empty results handling.
2026-02-20 10:44:09 +08:00
tw93
7c974bf351 fix(purge): prevent hangs during size calculation 2026-02-19 22:52:27 +08:00
tw93
9de661b5df fix(status): prefer internal disks over external in disk listing
When multiple disks are connected, the status command was sorting
only by size, causing external disks to appear first when they are
larger than the internal disk. This resulted in showing incorrect
free space (external disk size) instead of the internal disk.

The sort now prioritizes internal disks before sorting by size,
ensuring the internal disk always appears first.

Fixes #466
2026-02-16 19:08:25 +08:00
tw93
8e8059b0aa fix(status): resolve layout issue when stretching terminal window (#467)
When the terminal is stretched wide, the header info line may wrap to
multiple lines but the mole position was calculated independently based
on terminal width, causing vertical misalignment.

Separate header and mole rendering so mole always appears on dedicated
lines below the header regardless of terminal width.
2026-02-16 19:07:42 +08:00
tw93
abd9791cd7 feat(clean): add Maven local repository cleanup support 2026-02-16 18:54:19 +08:00
tw93
573f55e79e feat(clean): add Google Chrome/Updater cache cleanup support
Add cleanup for:
- Chrome component_crx_cache
- GoogleUpdater crx_cache
- GoogleUpdater *.old files

Closes #460
2026-02-16 16:09:24 +08:00
tw93
f21794d3d9 fix(clean): fix find -maxdepth position for BSD/macOS compatibility
On macOS (BSD find), -maxdepth must be placed before -name to work
correctly. When placed after, it was ignored causing find to scan
the entire home directory indefinitely on large directories.

Fixes #463
2026-02-16 16:05:22 +08:00
tw93
a29cadbfd0 fix(purge): resolve trap conflict between purge.sh and project.sh
- Add guard flag in cleanup_monitor to prevent duplicate execution
- Check for existing trap in project.sh before setting new one
- Prevents crash when user presses Ctrl-C or scan process fails
2026-02-16 15:54:16 +08:00
tw93
1a63b992c6 refactor(clean): simplify npm residual directories cleanup
Use loops instead of duplicated safe_clean calls for npm cache
directories (_cacache, _npx, _logs, _prebuilds). Add comments
explaining these are not removed by npm cache clean --force.
2026-02-16 15:53:32 +08:00
tw93
a61a427f88 feat(clean): add Expo cache cleanup support
Clean Expo/React Native caches in ~/.expo while preserving state.json
which contains authentication tokens.

Caches cleaned:
- expo-go/
- android-apk-cache/
- ios-simulator-app-cache/
- native-modules-cache/
- schema-cache/
- template-cache/
- versions-cache/

Closes #462
2026-02-16 15:45:21 +08:00
tw93
679ca2f30c Merge branch 'main' of https://github.com/tw93/Mole 2026-02-16 15:40:38 +08:00
github-actions[bot]
43d9bb237a chore: update contributors [skip ci] 2026-02-16 07:40:31 +00:00
Michael Aristarco
ab83bd1ed9 fix: deep clean npm residual caches (#457)
Fixes #454
2026-02-16 15:40:13 +08:00
tw93
685aa8b970 refactor(purge): improve React Native targets safety and clarity
- Clarify .cxx comment to indicate React Native NDK build cache
- Add protection for Xcode global DerivedData in ~/Library/Developer/Xcode/
  to prevent accidental deletion of shared build artifacts

Refs: #461
2026-02-16 15:39:00 +08:00
github-actions[bot]
db0b3a967a chore: update contributors [skip ci] 2026-02-16 07:37:25 +00:00
Dimitar Nestorov
a7c9b8d6ec feat(purge): add common React Native targets (#461) 2026-02-16 15:37:07 +08:00
tw93
88a4c83a2b fix: update version to 1.26.0 V1.26.0 2026-02-15 08:52:06 +08:00
tw93
950af1a5ed Improve clean progress visibility for dev runtime scans 2026-02-15 08:45:47 +08:00
tw93
52d333bc9e feat(uninstall): keep progress visible until app list is ready 2026-02-15 08:45:16 +08:00
tw93
91d0e5353a fix: handle cd failure in diagnostic report standalone test 2026-02-15 08:18:02 +08:00
github-actions[bot]
ad21e75f73 chore: update contributors [skip ci] 2026-02-15 00:04:38 +00:00
tw93
c896163d4b fix(clean): ensure flutter .dart_tool caches are discovered 2026-02-15 08:03:38 +08:00
tw93
744ecec4ba fix(clean): use sudo-safe cleanup for Xcode documentation cache 2026-02-15 07:52:43 +08:00
tw93
7d193526c3 fix(purge): support vim j/k navigation in selector 2026-02-15 07:48:35 +08:00
tw93
4a63ce330f fix(raycast): keep Ghostty window open after command 2026-02-14 20:37:00 +08:00
yamamel
0cde1041f9 feat(clean): add interactive Xcode simulator runtime volumes cleanup (#444)
* feat(clean): add interactive Xcode simulator runtime volumes cleanup

Scan CoreSimulator Volumes/Cryptex directories, detect IN_USE/UNUSED
status via mount points, and let users interactively select items to
clean. Also show size info for unavailable simulator cleanup.


* refactor(clean): auto-clean Xcode simulator runtime volumes

Remove interactive selector, now automatically cleans all UNUSED
runtime volumes while skipping IN_USE and protected paths.
2026-02-13 10:41:28 +08:00
Paul
2ee95f963e Add '$HOME/Developer' to common development paths (#447)
Add '$HOME/Developer' as it is a convention-based workspace directory on macOS
2026-02-13 10:30:33 +08:00
github-actions[bot]
c6423a56b8 chore: update contributors [skip ci] 2026-02-13 02:28:31 +00:00
Mario Vtor
a73a739b02 feat: add generic flutter clean support (#450)
* fix: re-apply flutter clean logic after branch switch

* fix(caches): unify hidden directory exclusion pattern

Restore */.* pattern to exclude all hidden directories consistently
across Next.js, Python, and Flutter scans. This prevents scanning
into .venv, .idea, .DS_Store and other hidden directories.

---------

Co-authored-by: tw93 <tw93@qq.com>
2026-02-13 10:28:12 +08:00
NeedmeFordev
85cd0253d5 feat(uninstall): remove app diagnostic reports from /Library/Logs/DiagnosticReports (fixes #441) (#443)
* Implement deleting files from DiagnosticReports

* fix(uninstall): avoid diagnostic size double-count and set -e exit

---------

Co-authored-by: tw93 <tw93@qq.com>
2026-02-11 14:35:45 +08:00
tw93
4c60fcca73 fix(uninstall): show full preview paths and add regression tests 2026-02-11 14:22:22 +08:00
github-actions[bot]
649f638a53 chore: update contributors [skip ci] 2026-02-11 02:40:56 +00:00