feat: add Homebrew provider, implement NameNormalizer across all managers

- Add brew package for Homebrew support on macOS and Linux
- Implement NameNormalizer interface (NormalizeName, ParseArch) for all providers
- Add darwin platform detection with Homebrew as default
- Consolidate capabilities by removing separate *_linux.go/*_other.go files
- Update tests for new capability expectations
- Add comprehensive tests for AUR and brew providers
- Update README with capability matrix and modern Target API usage

💘 Generated with Crush

Assisted-by: AWS Claude Opus 4.5 via Crush <crush@charm.land>
This commit is contained in:
2026-03-05 20:40:32 -05:00
parent 724ecc866e
commit 934c6610c5
60 changed files with 2554 additions and 967 deletions

View File

@@ -220,11 +220,8 @@ func upgradePackages(ctx context.Context, pkgs []snack.Target, opts ...snack.Opt
if len(toUpgrade) > 0 {
for _, t := range toUpgrade {
args := []string{"update", "-y", t.Name}
cmd := exec.CommandContext(ctx, "flatpak", args...)
var stderr bytes.Buffer
cmd.Stderr = &stderr
if err := cmd.Run(); err != nil {
return snack.InstallResult{}, fmt.Errorf("flatpak update %s: %w: %s", t.Name, err, stderr.String())
if _, err := run(ctx, args); err != nil {
return snack.InstallResult{}, fmt.Errorf("flatpak update %s: %w", t.Name, err)
}
}
}