1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 17:55:08 +00:00
Commit Graph

1764 Commits

Author SHA1 Message Date
tw93
66ba1889c6 fix: correct missing $ in color variable reference
Fix typo from PR #523: {NC} → ${NC}
2026-03-03 15:57:18 +08:00
Tw93
c41dcbcdee chore: auto format code 2026-03-03 07:52:51 +00:00
Angelk90
00f29cff20 Clean dynamic size formatting (#523) 2026-03-03 15:52:04 +08:00
tw93
d0e5e3618e Merge branch 'main' into dev 2026-03-03 15:42:13 +08:00
tw93
abb0b2b688 fix(clean): use defined ICON_WARNING instead of undefined ICON_SKIP
Ref #531
2026-03-03 15:39:45 +08:00
github-actions[bot]
509bbbfbcc chore: update contributors [skip ci] 2026-03-03 07:38:19 +00:00
Noah Qin
0da3d4ab23 fix(clean): enhance Xcode simulator cleanup with fallback mechanism (#531)
- Add simctl availability check before attempting cleanup
- Capture and analyze error output for better diagnostics
- Implement fallback: manual deletion when simctl fails
- Provide specific error hints (permission, in-use, service issues)
- Skip early when no unavailable simulators exist
- Show partial success status when some deletions fail

Error scenarios now handled:
- simctl not available → skip with friendly message
- Permission denied → show hint and try manual deletion
- Device in use → show hint and try manual deletion
- CoreSimulator service issues → show hint
- Partial failures → show "partially cleaned X/Y"

Fixes #520
2026-03-03 15:38:01 +08:00
github-actions[bot]
38601ec0d1 chore: update contributors [skip ci] 2026-03-03 02:04:59 +00:00
dependabot[bot]
0736892a57 chore(deps): bump actions/setup-go from 6.2.0 to 6.3.0 (#524)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](7a3fe6cf4c...4b73464bb3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: 6.3.0
  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-03-03 10:04:22 +08:00
dependabot[bot]
fd6d444e00 chore(deps): bump actions/upload-artifact from 6.0.0 to 7.0.0 (#525)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6.0.0 to 7.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](b7c566a772...bbbca2ddaa)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-03 10:04:08 +08:00
dependabot[bot]
e992cd351b chore(deps): bump actions/download-artifact from 7.0.0 to 8.0.0 (#526)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7.0.0 to 8.0.0.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](37930b1c2a...70fc10c6e5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-03 10:03:59 +08:00
dependabot[bot]
046af7682c chore(deps): bump github.com/shirou/gopsutil/v4 from 4.26.1 to 4.26.2 (#527)
Bumps [github.com/shirou/gopsutil/v4](https://github.com/shirou/gopsutil) from 4.26.1 to 4.26.2.
- [Release notes](https://github.com/shirou/gopsutil/releases)
- [Commits](https://github.com/shirou/gopsutil/compare/v4.26.1...v4.26.2)

---
updated-dependencies:
- dependency-name: github.com/shirou/gopsutil/v4
  dependency-version: 4.26.2
  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-03-03 10:03:50 +08:00
tw93
27a2cc5927 feat: show nightly channel in version output
Refs #517
2026-03-02 10:55:36 +08:00
github-actions[bot]
0a8f92cf83 chore: update contributors [skip ci] 2026-03-01 13:06:02 +00:00
tw93
d4116fbd49 docs(readme): reduce duplicate quick-start guidance 2026-03-01 21:04:48 +08:00
tw93
de57a20828 refactor(dry-run): unify flag handling in completion and remove 2026-03-01 21:04:41 +08:00
tw93
241e6a7a34 fix(purge): avoid counting failed dry-run removals 2026-03-01 20:35:49 +08:00
陳德生
05446e0847 Add dry-run support across destructive commands (#516)
* chore: update contributors [skip ci]

* Add dry-run support across destructive commands

Implement dry-run for uninstall, purge, installer, touchid, completion, and remove flows.\nGuard side effects in uninstall path (launchctl, defaults writes, kill/brew actions), update help/README, and add coverage in CLI/Bats tests.\n\nValidation: ./scripts/check.sh and ./scripts/test.sh (452 tests, 0 failures, 8 skipped).

* test(purge): keep dev-compatible purge coverage

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tw93 <hitw93@gmail.com>
2026-03-01 20:03:22 +08:00
tw93
adcd98096a fix(update): keep sudo session alive during installer run
Start sudo keepalive after authorization and clean it up on all failure/success paths to avoid repeated password prompts and overlapping update UI output. Closes #514.
2026-03-01 19:56:42 +08:00
tw93
172742b0d5 fix(version): avoid SIGPIPE in Homebrew install detection
Cache Homebrew formula output and use shell string matching to prevent pipefail SIGPIPE races that could misreport script installs as manual. Closes #513.
2026-03-01 19:56:33 +08:00
tw93
3b5707b078 fix(clean): skip pip cache cleanup when pip3 is macOS stub
On macOS 15+, /usr/bin/pip3 exists as a stub that triggers Command Line
Tools installation dialog. The previous check only verified command
existence, causing false "pip cache · would clean" output for users
without actual pip3 installed.

Now verifies pip3 is functional by checking `pip3 --version` before
attempting cleanup.

Fixes #512
2026-02-28 20:19:30 +08:00
Tw93
d40783cca9 chore: auto format code 2026-02-28 07:27:33 +00:00
tw93
c8190772ac refactor(core): remove unused utility functions
Remove unused functions from base.sh and ui.sh:
- base.sh: is_interactive, spinner stack management, get_terminal_info, validate_terminal_environment
- ui.sh: with_spinner

Net reduction: ~166 lines of dead code
2026-02-28 15:25:53 +08:00
tw93
2f1985ad6f fix(clean): clear spinner remnants after stopping
Add extra terminal clear to prevent spinner character remnants
when cleaning project caches.
2026-02-28 14:57:45 +08:00
tw93
60624f951b fix(clean): respect whitelist in Homebrew dry-run mode
Show "skipped whitelist" instead of "would cleanup" when Homebrew cache
is whitelisted, making dry-run behavior consistent with actual execution.
2026-02-28 14:57:44 +08:00
tw93
167bc7ac8d docs: Add local file path guideline to AGENTS.md and CLAUDE.md, and update .gitignore to ignore these and mole_guidelines.md. 2026-02-28 11:51:16 +08:00
tw93
022b42687e test: mock defaults in tmutil tests to bypass early check added in #510 2026-02-28 11:45:26 +08:00
tw93
7568bfc579 test: update bytes_to_human performance test inputs to use Base-10 values 2026-02-28 11:38:49 +08:00
tw93
9fed092283 test: update bytes_to_human test inputs to use Base-10 values V1.28.1 2026-02-28 11:30:17 +08:00
tw93
9d89bab922 fix(uninstall): run LaunchServices refresh async so Press Enter prompt appears immediately 2026-02-28 11:28:03 +08:00
tw93
c1f25eb854 chore: Bump version to 1.28.1 2026-02-28 11:23:38 +08:00
tw93
297111aa1b chore: Delete test_rounding.sh script. 2026-02-28 11:23:17 +08:00
tw93
d2820eeb2e fix(uninstall): sync LaunchServices refresh for Spotlight update, remove background hint message, close #490 2026-02-28 11:22:41 +08:00
tw93
75dc9f01dc refactor(clean): use assignment form for arithmetic increments in safe_clean 2026-02-28 11:22:35 +08:00
Tw93
194e8ad29a chore: auto format code 2026-02-28 03:11:16 +00:00
tw93
c19a0276b8 refactor: Update shell arithmetic increment syntax from ((var++)) || true to var=$((var + 1)) across various scripts. 2026-02-28 11:10:18 +08:00
tw93
7d70889ad4 chore: auto format code 2026-02-28 11:03:16 +08:00
tw93
1be71edc9d fix: use Base-10 sizes and mdls logical size to match macOS Finder
- Switch bytes_to_human (shell) and humanizeBytes (Go) from Base-2
  (1024) to Base-10 (1000) to match Apple's storage calculation
  standard since Snow Leopard
- Add proper decimal rounding instead of truncation
- Use mdls kMDItemLogicalSize for .app bundles to avoid APFS clone
  file undercounting by du

Fixes #511
2026-02-28 10:02:34 +08:00
tw93
646ff72a96 fix(clean): resolve unbound variable 'mount_points[@]' error in empty array case (#511) 2026-02-28 09:53:07 +08:00
Tw93
61cf5271eb chore: auto format code 2026-02-28 01:50:15 +00:00
tw93
68c9e93219 docs: clarify update instructions for script vs homebrew testers 2026-02-28 09:49:21 +08:00
tw93
310abb2510 fix: clean aerial wallpaper videos directly without 30d limit and bypass app protection wildcard, close #508 2026-02-28 09:49:16 +08:00
tw93
e8e4f91bf0 fix: use xattr -c without -r flag for compatibility, close #509 2026-02-28 09:49:16 +08:00
github-actions[bot]
c7563351b9 chore: update contributors [skip ci] 2026-02-28 01:35:46 +00:00
tw93
5710679809 fix: skip Time Machine checks when not configured, close #510
Use a fast `defaults read` pre-check before spawning any tmutil
process. On machines without Time Machine configured the check
returns instantly, avoiding the spinner and the 2-3s tmutil timeout.

Affected locations:
- lib/clean/system.sh: clean_time_machine_failed_backups()
- lib/clean/system.sh: clean_local_snapshots()
- lib/clean/user.sh: local snapshot hint in system hints
2026-02-28 09:35:08 +08:00
Tw93
922f5f1fc9 feat: add cleanup for aerial wallpaper videos
Add support for cleaning old aerial wallpaper videos in:
/Users/user/Library/Application Support/com.apple.wallpaper/aerials/videos

These video files can consume significant disk space (up to 50GB+) and
are safe to remove - macOS will re-download them on demand.

Uses MOLE_SUPPORT_CACHE_AGE_DAYS (default 30 days) to avoid removing
recently used wallpapers.

Closes #508
2026-02-27 23:46:40 +08:00
Tw93
c129591cf4 fix: remove redundant pipefail blocks and fix arithmetic bug
This commit addresses the issue #506 where mole would exit prematurely
during application support scanning.

Changes:
1. Remove 4 redundant pipefail disable/restore blocks:
   - safe_find_delete() in lib/core/file_ops.sh
   - safe_sudo_find_delete() in lib/core/file_ops.sh
   - fix_broken_preferences() in lib/optimize/maintenance.sh
   - opt_saved_state_cleanup() in lib/optimize/tasks.sh

   These were unnecessary because process substitution (< <(cmd)) is not
   affected by pipefail - only real pipelines (cmd1 | cmd2) are.

2. Fix real bug in fix_broken_preferences():
   - Add || true to ((broken_count++)) on lines 35 and 55
   - This prevents set -e from exiting when broken_count starts at 0

Fixes #506
2026-02-27 23:44:10 +08:00
Tw93
a8065dfbae fix(application_support_logs): prevent process substitution failures by temporarily disabling pipefail 2026-02-27 23:20:04 +08:00
Tw93
013549ad25 fix: temporarily disable pipefail to prevent process substitution failures during cleanup operations 2026-02-27 22:52:38 +08:00
tw93
a9433e4acd fix: preserve interrupt semantics and restore purge traps 2026-02-27 11:18:53 +08:00