mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-18 03:56:52 +02:00
fix: nfpm default build ids to empty
This commit is contained in:
parent
cd7edb7a2e
commit
9dfade2558
@ -54,11 +54,6 @@ func (Pipe) Default(ctx *context.Context) error {
|
||||
if fpm.FileNameTemplate == "" {
|
||||
fpm.FileNameTemplate = defaultNameTemplate
|
||||
}
|
||||
if len(fpm.Builds) == 0 { // TODO: change this to empty by default and deal with it in the filtering code
|
||||
for _, b := range ctx.Config.Builds {
|
||||
fpm.Builds = append(fpm.Builds, b.ID)
|
||||
}
|
||||
}
|
||||
ids.Inc(fpm.ID)
|
||||
}
|
||||
|
||||
|
@ -565,15 +565,11 @@ func TestDefault(t *testing.T) {
|
||||
NFPMs: []config.NFPM{
|
||||
{},
|
||||
},
|
||||
Builds: []config.Build{
|
||||
{ID: "foo"},
|
||||
{ID: "bar"},
|
||||
},
|
||||
},
|
||||
}
|
||||
require.NoError(t, Pipe{}.Default(ctx))
|
||||
require.Equal(t, "/usr/bin", ctx.Config.NFPMs[0].Bindir)
|
||||
require.Equal(t, []string{"foo", "bar"}, ctx.Config.NFPMs[0].Builds)
|
||||
require.Empty(t, ctx.Config.NFPMs[0].Builds)
|
||||
require.Equal(t, defaultNameTemplate, ctx.Config.NFPMs[0].FileNameTemplate)
|
||||
require.Equal(t, ctx.Config.ProjectName, ctx.Config.NFPMs[0].PackageName)
|
||||
}
|
||||
@ -581,10 +577,6 @@ func TestDefault(t *testing.T) {
|
||||
func TestDefaultSet(t *testing.T) {
|
||||
ctx := &context.Context{
|
||||
Config: config.Project{
|
||||
Builds: []config.Build{
|
||||
{ID: "foo"},
|
||||
{ID: "bar"},
|
||||
},
|
||||
NFPMs: []config.NFPM{
|
||||
{
|
||||
Builds: []string{"foo"},
|
||||
|
@ -24,7 +24,7 @@ nfpms:
|
||||
file_name_template: "{{ .ConventionalFileName }}"
|
||||
|
||||
# Build IDs for the builds you want to create NFPM packages for.
|
||||
# Defaults to all builds.
|
||||
# Defaults empty, which means no filtering.
|
||||
builds:
|
||||
- foo
|
||||
- bar
|
||||
|
Loading…
x
Reference in New Issue
Block a user