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

ldflags template

This commit is contained in:
Carlos Alexandro Becker
2017-03-25 20:24:38 -03:00
parent 9a71fba785
commit 4af2cb00ea
14 changed files with 224 additions and 56 deletions

View File

@ -49,5 +49,10 @@ func (Pipe) Run(ctx *context.Context) (err error) {
if matches, err := regexp.MatchString("^[0-9.]+", ctx.Version); !matches || err != nil {
return ErrInvalidVersionFormat{ctx.Version}
}
commit, err := commitHash()
if err != nil {
return
}
ctx.Git.Commit = commit
return
}