From 5f22a60496198ad2995610daa0d3a2918720be33 Mon Sep 17 00:00:00 2001 From: Corbin Phelps Date: Thu, 19 May 2022 21:14:17 -0400 Subject: [PATCH] fix: Modified brew formula class generation to remove dots to match what homebrew expects Signed-off-by: Corbin Phelps --- internal/pipe/brew/brew.go | 2 +- internal/pipe/brew/brew_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/pipe/brew/brew.go b/internal/pipe/brew/brew.go index 83b87759c25..0a0505032e8 100644 --- a/internal/pipe/brew/brew.go +++ b/internal/pipe/brew/brew.go @@ -408,7 +408,7 @@ func split(s string) []string { func formulaNameFor(name string) string { name = strings.ReplaceAll(name, "-", " ") name = strings.ReplaceAll(name, "_", " ") - name = strings.ReplaceAll(name, ".", "_") + name = strings.ReplaceAll(name, ".", "") name = strings.ReplaceAll(name, "@", "AT") return strings.ReplaceAll(strings.Title(name), " ", "") // nolint:staticcheck } diff --git a/internal/pipe/brew/brew_test.go b/internal/pipe/brew/brew_test.go index 99e16d45c60..62d6529d4b2 100644 --- a/internal/pipe/brew/brew_test.go +++ b/internal/pipe/brew/brew_test.go @@ -28,7 +28,7 @@ func TestNameWithUnderline(t *testing.T) { } func TestNameWithDots(t *testing.T) { - require.Equal(t, formulaNameFor("binaryv0.0.0"), "Binaryv0_0_0") + require.Equal(t, formulaNameFor("binaryv0.0.0"), "Binaryv000") } func TestNameWithAT(t *testing.T) {