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

1763 Commits

Author SHA1 Message Date
tw93
bbe3d3f284 fix(status): keep compact header single-line on tight widths 2026-02-27 10:07:44 +08:00
tw93
f4118dc883 fix(status): hide os and uptime in compact header 2026-02-27 10:02:47 +08:00
tw93
15f698c606 fix(status): hide swap size text when card is narrow 2026-02-27 10:02:06 +08:00
tw93
0341ae6648 perf(clean): speed up memory report size pre-scan 2026-02-27 09:53:27 +08:00
tw93
8436377922 test(status): add narrow-width rendering coverage 2026-02-27 09:53:24 +08:00
tw93
369d3b8840 fix(status): wrap header and card output on narrow terminals 2026-02-27 09:53:21 +08:00
tw93
9056ce5b38 fix(status): adapt single-column width calculation 2026-02-27 09:53:18 +08:00
tw93
2eb0f2b9b3 fix(log): generate summary divider width from terminal width
Replace hardcoded 70-char string with a dynamically generated divider
capped at terminal width (max 70) so the separator fits narrow terminals
instead of overflowing them.
2026-02-26 19:42:58 +08:00
tw93
6c0aa87389 fix(clean): guard DRY_RUN against unbound variable in system.sh
Change "$DRY_RUN" to "${DRY_RUN:-}" so the check is safe under
set -euo pipefail when DRY_RUN is not exported by the caller (e.g.
unit tests that source lib/clean/system.sh directly without going
through bin/clean.sh which initialises the variable).
2026-02-26 19:42:52 +08:00
tw93
7a6da7b419 fix(uninstall): auto-exit return-to-list prompt after configurable timeout
Replace blocking read with a timed read (default 3 s) so the prompt
exits automatically instead of waiting forever. Timeout is configurable
via MOLE_UNINSTALL_RETURN_PROMPT_TIMEOUT_SEC. Use a read_ok flag to
distinguish timeout (exit) from Enter (return to list).
2026-02-26 19:42:47 +08:00
tw93
d13c0927a6 feat(purge): add confirm dialog, two-pass column alignment, adaptive footer
- Add confirm_purge_cleanup() to show item count + size and require
  explicit Enter/y confirmation before any deletion
- Two-pass layout in clean_project_artifacts: pass 1 collects data,
  pre-scan finds max path and artifact widths, pass 2 formats with
  consistent column alignment across all rows
- Adaptive footer hints in select_purge_categories degrade gracefully
  on narrow terminals (full → reduced → minimal)
- Use printf '\033[J' to clear stale content when list height shrinks
- Guard empty-array expansions with ${arr[*]-} for set -u safety
- Add BATS tests for confirm_purge_cleanup (Enter confirm, ESC cancel)
2026-02-26 19:42:42 +08:00
tw93
837df390a5 fix(purge): rewrite spinner for /dev/tty reliability and fix cursor position
- Capture terminal width in parent before forking; avoids unreliable
  tput calls inside the background subshell
- Write spinner output directly to /dev/tty to prevent stdout state
  contention between parent and background processes
- Use \033[2K (erase entire line) instead of \033[K (erase to EOL)
- Add handle_interrupt() so Ctrl-C cleanly stops spinner, restores
  cursor, and exits 130
- cleanup_monitor now writes \r\033[2K\n so subsequent output starts
  on a clean line rather than on the cleared spinner line
2026-02-26 19:42:34 +08:00
tw93
e17f35eb57 fix(uninstall): show next-step prompt without post-cleanup delay 2026-02-26 16:43:09 +08:00
tw93
aa1a436862 fix(clean): improve loading feedback and spinner output 2026-02-26 16:36:06 +08:00
Tw93
b3f023b5e6 chore: auto format code 2026-02-26 03:54:50 +00:00
tw93
29ec8f7d43 style(clean): unify DRY_RUN variable check style
Use consistent "$DRY_RUN" check instead of "${DRY_RUN:-false}"
to match project conventions.
2026-02-26 11:53:54 +08:00
tw93
3e47cdb39e refactor(uninstall): use shared get_lsregister_path from base.sh
Remove duplicate get_lsregister_path() implementation and use the
shared utility from base.sh instead.
2026-02-26 11:53:49 +08:00
tw93
d0e1a200d6 refactor(optimize): use shared get_lsregister_path from base.sh
Remove duplicate get_lsregister_path() implementation and use the
shared utility from base.sh instead.
2026-02-26 11:53:44 +08:00
tw93
88b0fe6af3 refactor(base): extract get_lsregister_path as shared utility
Move get_lsregister_path() to base.sh to avoid duplication across
optimize and uninstall modules. Adds macOS 14+ compatibility with
fallback paths.
2026-02-26 11:53:39 +08:00
github-actions[bot]
f394e7552c chore: update contributors [skip ci] 2026-02-26 03:48:32 +00:00
tw93
0b5ac830e5 test(clean): add test for Application Support size counting
- Add test for nested directory contents in dry-run size summary
2026-02-26 11:47:51 +08:00
tw93
980bbcd3c3 fix(uninstall): improve LaunchServices path detection for macOS 14+
- Add fallback paths for lsregister tool
- Check executable permission before using path
2026-02-26 11:47:46 +08:00
tw93
3bd3e400b6 style: improve code consistency and formatting
- Rename _MOLE_HINTS_DIR to mole_hints_dir (naming convention)
- Split local variable declaration and assignment
- Add ICON_INFO constant to base.sh
- Remove redundant has_cached_sudo function (use has_sudo_session)
2026-02-26 11:47:41 +08:00
tw93
3c3c976b5b fix(optimize): use ICON constants and improve LaunchServices path detection
- Replace Unicode characters with ICON_SUCCESS and ICON_INFO constants
- Add fallback paths for lsregister tool (macOS 14+ compatibility)
2026-02-26 11:47:33 +08:00
tw93
ceac7957aa fix(clean): correct Messages check logic and improve Application Support scanning
- Fix Messages running check to not skip CrashReporter/idleassetsd cleanup
- Add proper spacing between function definitions
- Add app_support_item_size_bytes() for accurate size calculation
- Improve progress reporting during Application Support scan
2026-02-26 11:47:28 +08:00
github-actions[bot]
7f474f570e chore: update contributors [skip ci] 2026-02-26 02:34:07 +00:00
tw93
44e1c61af3 Merge remote-tracking branch 'origin/main' into dev 2026-02-26 10:33:24 +08:00
tw93
5d69968ac0 perf: improve Application Support scan progress and size accounting 2026-02-26 10:33:19 +08:00
github-actions[bot]
b269501b9b chore: update contributors [skip ci] 2026-02-26 02:30:04 +00:00
诺亚Q
dc7380d5b2 fix: avoid hang on large Application Support directories (#495) (#496)
Replace du traversal + double find with single find -print0 + stat -f%z
to eliminate 8+ minute hang on directories with 392K files. Add progress
feedback via update_progress_if_needed in the outer loop.
2026-02-26 10:29:46 +08:00
tw93
5241b59ea9 refactor: reuse sudo cache checks in clean dry-run tests 2026-02-25 10:32:12 +08:00
Luke Bullimore
ee1f2bd372 Fix --dry-run hiding system cleanup preview (#493)
The dry-run mode hardcoded SYSTEM_CLEAN=false, which meant
the entire system section was silently skipped during preview.
Users had no way to see what /Library/Caches, /private/var/log,
diagnostics, or other sudo-required paths would be cleaned.

Now dry-run checks for a cached sudo session (sudo -n) and
includes the system preview when available. When sudo isn't
cached, a hint tells the user how to get the full preview
without running the whole script as root.
2026-02-25 10:22:56 +08:00
tw93
7c1fedae12 Merge branch 'main' of https://github.com/tw93/Mole
# Conflicts:
#	lib/clean/project.sh
2026-02-25 10:20:32 +08:00
tw93
258d78991a fix: refresh launchservices after app uninstall 2026-02-24 14:26:33 +08:00
tw93
7dac5dc4e2 refactor quick launcher metadata and docs 2026-02-24 14:24:46 +08:00
tw93
db602a0022 fix: skip font cache rebuild when browsers are running 2026-02-24 14:23:00 +08:00
tw93
8bd257a9c2 refactor(purge): reuse shared size formatter in header 2026-02-24 14:20:25 +08:00
Tw93
6754a5544b chore: auto format code 2026-02-24 06:18:44 +00:00
github-actions[bot]
b9c067fec9 chore: update contributors [skip ci] 2026-02-24 06:18:09 +00:00
Sky Slinger
98089eeba8 Fix(raycast) : Made mole script commands discoverable (#489) 2026-02-24 14:17:51 +08:00
github-actions[bot]
4f4a1942ad chore: update contributors [skip ci] 2026-02-24 06:17:41 +00:00
Angelk90
ae5e81722b Fix (#486) 2026-02-24 14:17:20 +08:00
tw93
b864b61891 test(update): cover nightly update flows 2026-02-23 13:39:31 +08:00
tw93
3e3594dc58 fix(clean): avoid false success for third-party log cleanup 2026-02-23 13:39:27 +08:00
tw93
ff00e9ba9c refactor(clean): extract shared purge hint helpers 2026-02-23 13:39:22 +08:00
tw93
4c9a71315f refactor(ui): unify action and list hints across commands 2026-02-23 11:34:22 +08:00
tw93
3112673ed3 feat(clean): add storage clues after large files 2026-02-23 11:34:04 +08:00
tw93
1169cbf198 fix(purge): avoid command find in fallback scan (#478) 2026-02-23 08:15:47 +08:00
tw93
8f5b70457e fix(purge): normalize search roots for scan filtering (#478) 2026-02-22 22:06:19 +08:00
tw93
082cc1d09b feat(update): add --nightly channel for script installs
Refs #482
2026-02-22 21:25:42 +08:00