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

feat: allow env vars for checksum name_template

Allow env vars for the checksum name_template.
This commit is contained in:
Frank Schroeder 2017-12-17 22:54:07 +01:00
parent 0d9b227f48
commit 0780c232fc
No known key found for this signature in database
GPG Key ID: 4D65C6EAEC87DECD
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
}