mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-16 03:52:12 +02:00
fix: skip defaults for skipped pipes (#4210)
closes #4208 --------- Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
parent
c06ba3a94f
commit
dccd68c126
@ -8,6 +8,7 @@ import (
|
||||
|
||||
"github.com/goreleaser/goreleaser/internal/client"
|
||||
"github.com/goreleaser/goreleaser/internal/middleware/errhandler"
|
||||
"github.com/goreleaser/goreleaser/internal/middleware/skip"
|
||||
"github.com/goreleaser/goreleaser/internal/tmpl"
|
||||
"github.com/goreleaser/goreleaser/pkg/context"
|
||||
"github.com/goreleaser/goreleaser/pkg/defaults"
|
||||
@ -38,7 +39,10 @@ func (Pipe) Run(ctx *context.Context) error {
|
||||
ctx.Config.GiteaURLs.Download = strings.TrimSuffix(strings.ReplaceAll(apiURL, "/api/v1", ""), "/")
|
||||
}
|
||||
for _, defaulter := range defaults.Defaulters {
|
||||
if err := errhandler.Handle(defaulter.Default)(ctx); err != nil {
|
||||
if err := skip.Maybe(
|
||||
defaulter,
|
||||
errhandler.Handle(defaulter.Default),
|
||||
)(ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
@ -94,6 +94,7 @@ func TestFillPartial(t *testing.T) {
|
||||
require.NotEmpty(t, ctx.Config.Dockers[0].Dockerfile)
|
||||
require.Equal(t, "disttt", ctx.Config.Dist)
|
||||
require.NotEqual(t, "https://github.com", ctx.Config.GitHubURLs.Download)
|
||||
require.Empty(t, ctx.Config.Nix, "nix should have been skipped")
|
||||
|
||||
ctx = testctx.NewWithCfg(config.Project{
|
||||
GiteaURLs: config.GiteaURLs{
|
||||
|
@ -80,7 +80,7 @@ var Defaulters = []Defaulter{
|
||||
blob.Pipe{},
|
||||
upload.Pipe{},
|
||||
aur.Pipe{},
|
||||
nix.Pipe{},
|
||||
nix.NewPublish(),
|
||||
winget.Pipe{},
|
||||
brew.Pipe{},
|
||||
krew.Pipe{},
|
||||
|
Loading…
Reference in New Issue
Block a user