1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

fix: blank project name in some cases

closes #607
This commit is contained in:
Carlos Alexandro Becker 2018-03-12 08:30:38 -03:00
parent 7648760108
commit 093291f3ad
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
2 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,9 @@ func (Pipe) Default(ctx *context.Context) error {
ctx.Config.Release.NameTemplate = "{{.Tag}}"
}
if ctx.Config.Release.GitHub.Name != "" {
if ctx.Config.ProjectName == "" {
ctx.Config.ProjectName = ctx.Config.Release.GitHub.Name
}
return nil
}
repo, err := remoteRepo()

View File

@ -168,6 +168,7 @@ func TestDefaultFilled(t *testing.T) {
},
}
assert.NoError(t, Pipe{}.Default(ctx))
assert.Equal(t, "foo", ctx.Config.ProjectName)
assert.Equal(t, "foo", ctx.Config.Release.GitHub.Name)
assert.Equal(t, "bar", ctx.Config.Release.GitHub.Owner)
}