mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-03-17 20:47:50 +02:00
fix: nfpm replacements deprecation (#3793)
closes #3792 Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
parent
2c80588251
commit
1858bace7e
@ -62,6 +62,11 @@ func (Pipe) Default(ctx *context.Context) error {
|
||||
if len(fpm.Replacements) != 0 {
|
||||
deprecate.Notice(ctx, "nfpms.replacements")
|
||||
}
|
||||
for _, rfpm := range fpm.Overrides {
|
||||
if len(rfpm.Replacements) != 0 {
|
||||
deprecate.Notice(ctx, "nfpms.replacements")
|
||||
}
|
||||
}
|
||||
ids.Inc(fpm.ID)
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,42 @@ func TestRunPipeNoFormats(t *testing.T) {
|
||||
testlib.AssertSkipped(t, Pipe{}.Run(ctx))
|
||||
}
|
||||
|
||||
func TestDefaultsDeprecated(t *testing.T) {
|
||||
t.Run("replacements", func(t *testing.T) {
|
||||
ctx := context.New(config.Project{
|
||||
NFPMs: []config.NFPM{
|
||||
{
|
||||
NFPMOverridables: config.NFPMOverridables{
|
||||
Replacements: map[string]string{
|
||||
"linux": "Tux",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
require.NoError(t, Pipe{}.Default(ctx))
|
||||
require.True(t, ctx.Deprecated)
|
||||
})
|
||||
|
||||
t.Run("replacements overrides", func(t *testing.T) {
|
||||
ctx := context.New(config.Project{
|
||||
NFPMs: []config.NFPM{
|
||||
{
|
||||
Overrides: map[string]config.NFPMOverridables{
|
||||
"apk": {
|
||||
Replacements: map[string]string{
|
||||
"linux": "Tux",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
require.NoError(t, Pipe{}.Default(ctx))
|
||||
require.True(t, ctx.Deprecated)
|
||||
})
|
||||
}
|
||||
|
||||
func TestRunPipeError(t *testing.T) {
|
||||
ctx := context.New(config.Project{
|
||||
Dist: t.TempDir(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user