Created optional flag `--exclude-volumes` for `mo analyze` to consent the users to analyze the filesystem without taking in consideration attached Volumes.
Normal behaviour (with volumes included) is left untouched.
- Fix safe_sudo_remove early exit on error (P1)
- Fix menu filter state leakage in paginated menu (P2)
- Fix cleanup of MOLE_MENU_FILTER_NAMES in app selector (P2)
- Correct log_operation signature for memory dumps (P2)
- Apply minor formatting fixes to dev cleanup module
Fixes the issue reported in PR #410 where mo purge fails to find
artifacts when fd returns empty results.
Changes:
- Implement MO_USE_FIND environment variable to force using find
- Improve fd fallback: check if fd output is empty (-s test)
- Add debug logging to show which tool is being used
- If fd returns no results, fallback to find automatically
This fixes the root cause where fd successfully runs (exit 0) but
finds nothing, preventing the find fallback from being triggered.
Fixes the issue reported in PR #410 where `mo purge` fails to find
artifacts when `fd` returns empty results.
Changes:
- Implement MO_USE_FIND environment variable to force using find
- Improve fd fallback: check if fd output is empty (-s test)
- Add debug logging to show which tool is being used
- If fd returns no results, fallback to find automatically
This fixes the root cause where fd successfully runs (exit 0) but
finds nothing, preventing the find fallback from being triggered.
Optimization:
- Skip -name "*" in safe_sudo_find_delete when pattern matches everything
- Reduces unnecessary parameter passing to find command
- Improves performance for operations that scan all files
Rationale:
- find -name "*" is redundant as it matches everything by default
- Removing it reduces command overhead without changing behavior
Performance improvements:
- Merge 3 separate find operations into 1 for /Library/Caches
- Combine *.cache, *.tmp, *.log patterns in single scan
- Reduces filesystem traversal overhead
- Merge 2 find operations into 1 for /private/var/log
- Combine *.log and *.gz patterns
- Optimize diagnostics cleanup with single combined scan
- Merge Special, Persist, and tracev3 patterns
- Reduces redundant directory traversal
- Use find -delete for batch removal of memory exception reports
- More efficient than iterative removal for large file counts
- Add summary logging to operations.log
UI improvements:
- Add granular spinner messages for each cleanup stage
- Separate diagnostic logs and power logs output for clarity
- Add progress feedback during Time Machine status check
Tests:
- Update sudo mock functions to support new combined find patterns
- Verify find -delete usage for memory exception cleanup
- Update assertions to match optimized implementation