Skip to content

Commit fa41479

Browse files
committed
fix: normalize tap formulae names instead of filtering them out
brew leaves outputs tap formulae as "user/repo/formula" (e.g. "cirruslabs/cli/tart"). Previous fix incorrectly filtered these out entirely, losing real packages. Now extracts just the formula name (e.g. "tart") so packages are preserved. The tap itself is still captured separately by CaptureTaps().
1 parent 08ecd31 commit fa41479

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

internal/snapshot/capture.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,17 @@ func CaptureFormulae() ([]string, error) {
300300
return nil, err
301301
}
302302

303-
// Filter out tap formulae (e.g. "openbootdotdev/tap", "user/tap/formula")
304-
// which brew leaves includes but are not standalone packages.
303+
// Normalize tap formulae: "user/repo/formula" → "formula"
304+
// These are real packages installed from third-party taps.
305+
// The tap itself is captured separately by CaptureTaps().
306+
// Storing just the formula name avoids confusion in the UI
307+
// and matches what "brew install formula" expects.
305308
var formulae []string
306309
for _, f := range all {
307-
if !strings.Contains(f, "/") {
310+
if strings.Contains(f, "/") {
311+
parts := strings.Split(f, "/")
312+
formulae = append(formulae, parts[len(parts)-1])
313+
} else {
308314
formulae = append(formulae, f)
309315
}
310316
}

0 commit comments

Comments
 (0)