Skip to content

Commit

Permalink
fix: Modified brew formula class generation to remove dots to match w…
Browse files Browse the repository at this point in the history
…hat homebrew expects (#3117)

Signed-off-by: Corbin Phelps <corbin.phelps@bluemedora.com>

Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
cpheps and caarlos0 committed May 20, 2022
1 parent cc27fba commit 8dde97c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/pipe/brew/brew.go
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion internal/pipe/brew/brew_test.go
Expand Up @@ -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) {
Expand Down

0 comments on commit 8dde97c

Please sign in to comment.