From 6645c581141529106751ebdd085781c9cc6034e9 Mon Sep 17 00:00:00 2001 From: Eduardo Lopez Date: Tue, 26 May 2020 10:50:39 -0400 Subject: [PATCH] fix: Brew versioned formulae now supported (#1568) --- internal/pipe/brew/brew.go | 1 + internal/pipe/brew/brew_test.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/internal/pipe/brew/brew.go b/internal/pipe/brew/brew.go index d0046b342..36fa5d4a5 100644 --- a/internal/pipe/brew/brew.go +++ b/internal/pipe/brew/brew.go @@ -309,5 +309,6 @@ func split(s string) []string { func formulaNameFor(name string) string { name = strings.Replace(name, "-", " ", -1) name = strings.Replace(name, "_", " ", -1) + name = strings.Replace(name, "@", "AT", -1) return strings.Replace(strings.Title(name), " ", "", -1) } diff --git a/internal/pipe/brew/brew_test.go b/internal/pipe/brew/brew_test.go index f0b5d801a..b4c4938b2 100644 --- a/internal/pipe/brew/brew_test.go +++ b/internal/pipe/brew/brew_test.go @@ -29,6 +29,10 @@ func TestNameWithUnderline(t *testing.T) { assert.Equal(t, formulaNameFor("some_binary"), "SomeBinary") } +func TestNameWithAT(t *testing.T) { + assert.Equal(t, formulaNameFor("some_binary@1"), "SomeBinaryAT1") +} + func TestSimpleName(t *testing.T) { assert.Equal(t, formulaNameFor("binary"), "Binary") }