1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/internal/client/name.go
Carlos Alexandro Becker 9021160b11 fix: break if env not available
closes #467
2018-01-02 19:01:55 -02:00

27 lines
527 B
Go

package client
import (
"bytes"
"text/template"
"github.com/goreleaser/goreleaser/context"
)
func releaseTitle(ctx *context.Context) (string, error) {
var out bytes.Buffer
t, err := template.New("github").
Option("missingkey=error").
Parse(ctx.Config.Release.NameTemplate)
if err != nil {
return "", err
}
err = t.Execute(&out, struct {
ProjectName, Tag, Version string
}{
ProjectName: ctx.Config.ProjectName,
Tag: ctx.Git.CurrentTag,
Version: ctx.Version,
})
return out.String(), err
}