-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Description
Phase 4: Cleanup Modules
Implement Homebrew cleanup module for macOS and Linux (Linuxbrew).
Implementation
In Infrastructure/Modules/Homebrew/HomebrewModule.cs
- Implements
ICleanupModule - Uses
brewCLI viaICommandRunner
Features to Port from Bash
From src/modules/homebrew.sh:
- Remove outdated package versions -
remove_outdated_package_versions - Remove unused dependencies (orphans) -
remove_unused_dependencies - Clear Homebrew download cache -
clear_homebrew_download_cache - Update and diagnose -
update_and_diagnose_homebrew
AnalyzeAsync
- Check if
brewcommand is available - Get cache path:
brew --cache - Estimate sizes for outdated packages and cache
- Return
List<CleanupTarget>
CleanAsync
- Execute cleanup operations
- Run
brew cleanup - Run
brew autoremove - Optional:
brew updateandbrew doctor - Return
List<CleanupResult>
Properties
Name: ModuleName.HomebrewDescription: "Clean Homebrew (old packages, cache, diagnostics)"IsDestructive: falseIsAvailableOnPlatform: true for macOS/Linux, false for Windows
Tests to Port
All in tests/Infrastructure/Modules/Homebrew/HomebrewModuleTests.cs
Port tests from bash tests/unit/homebrew_test.sh:
- Brew availability check
- Cache path detection
- Outdated package removal
- Dependency cleanup
- Platform availability (skip on Windows)
Definition of Done
- HomebrewModule fully implemented
- All bash tests ported
- Works on macOS and Linux (Linuxbrew)
- Skipped gracefully on Windows
- ~500MB-2GB typical recovery
Reactions are currently unavailable