1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-23 20:30:07 +00:00

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>
This commit is contained in:
陳德生
2026-03-01 20:03:22 +08:00
committed by GitHub
parent adcd98096a
commit 05446e0847
18 changed files with 1021 additions and 684 deletions

View File

@@ -68,6 +68,12 @@ mo clean --dry-run --debug # Detailed preview with risk levels and file info
mo optimize --dry-run # Preview optimization actions
mo optimize --debug # Run with detailed operation logs
mo optimize --whitelist # Manage protected optimization rules
mo uninstall --dry-run # Preview app uninstall actions
mo purge --dry-run # Preview project artifact purge
mo installer --dry-run # Preview installer cleanup actions
mo touchid enable --dry-run # Preview Touch ID sudo config changes
mo completion --dry-run # Preview shell completion file updates
mo remove --dry-run # Preview Mole self-removal
mo purge --paths # Configure project scan directories
mo analyze /Volumes # Analyze external drives only
```
@@ -75,7 +81,7 @@ mo analyze /Volumes # Analyze external drives only
## Tips
- Video tutorial: Watch the [Mole tutorial video](https://www.youtube.com/watch?v=UEe9-w4CcQ0), thanks to PAPAYA 電腦教室.
- Safety first: Deletions are permanent. Review carefully and preview with `mo clean --dry-run`. See [Security Audit](SECURITY_AUDIT.md).
- Safety first: Deletions are permanent. Review carefully with dry-run before applying changes. See [Security Audit](SECURITY_AUDIT.md).
- Debug and logs: Use `--debug` for detailed logs. Combine with `--dry-run` for a full preview. File operations are logged to `~/.config/mole/operations.log`. Disable with `MO_NO_OPLOG=1`.
- Navigation: Mole supports arrow keys and Vim bindings `h/j/k/l`.