1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-01 13:07:49 +02:00

fix: Brew versioned formulae now supported (#1568)

This commit is contained in:
Eduardo Lopez 2020-05-26 10:50:39 -04:00 committed by GitHub
parent 5f41640978
commit 6645c58114
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -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)
}

View File

@ -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")
}