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

Merge pull request #465 from magiconair/checksums-with-env-vars

feat: allow env vars for checksum name_template
This commit is contained in:
Carlos Alexandro Becker 2017-12-19 19:32:09 -02:00 committed by GitHub
commit dd6b650017
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -16,6 +16,7 @@ checksum:
# - ProjectName
# - Tag
# - Version (Git tag without `v` prefix)
# - Env (environment variables)
# Default is `{{ .ProjectName }}_{{ .Version }}_checksums.txt`.
name_template: "{{ .ProjectName }}_checksums.txt"
```

View File

@ -14,11 +14,15 @@ func filenameFor(ctx *context.Context) (string, error) {
return "", err
}
err = t.Execute(&out, struct {
ProjectName, Tag, Version string
ProjectName string
Tag string
Version string
Env map[string]string
}{
ProjectName: ctx.Config.ProjectName,
Tag: ctx.Git.CurrentTag,
Version: ctx.Version,
Env: ctx.Env,
})
return out.String(), err
}