Skip to content

Commit 42bb1b1

Browse files
committed
revert: keep full tap formula names in snapshot
Revert the normalization of tap formulae names. "user/repo/formula" is a valid brew install target that auto-taps. Stripping the prefix loses information and can cause name collisions. The display issue should be fixed in the web UI instead.
1 parent fa41479 commit 42bb1b1

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

internal/snapshot/capture.go

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -295,26 +295,7 @@ func captureBrewList(args ...string) ([]string, error) {
295295
}
296296

297297
func CaptureFormulae() ([]string, error) {
298-
all, err := captureBrewList("leaves")
299-
if err != nil {
300-
return nil, err
301-
}
302-
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.
308-
var formulae []string
309-
for _, f := range all {
310-
if strings.Contains(f, "/") {
311-
parts := strings.Split(f, "/")
312-
formulae = append(formulae, parts[len(parts)-1])
313-
} else {
314-
formulae = append(formulae, f)
315-
}
316-
}
317-
return formulae, nil
298+
return captureBrewList("leaves")
318299
}
319300

320301
func CaptureCasks() ([]string, error) {

0 commit comments

Comments
 (0)