1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-02-01 13:07:49 +02:00

fix: improve docker warning

This commit is contained in:
Carlos A Becker 2022-11-30 22:47:53 -03:00
parent a2308ee608
commit a3d3ab2058
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -129,9 +129,6 @@ func (Pipe) Run(ctx *context.Context) error {
} }
artifacts := ctx.Artifacts.Filter(artifact.And(filters...)) artifacts := ctx.Artifacts.Filter(artifact.And(filters...))
log.WithField("artifacts", artifacts.Paths()).Debug("found artifacts") log.WithField("artifacts", artifacts.Paths()).Debug("found artifacts")
if len(artifacts.Paths()) == 0 {
log.Warn("not binaries or packages found for the given platform - COPY/ADD may not work")
}
return process(ctx, docker, artifacts.List()) return process(ctx, docker, artifacts.List())
}) })
} }
@ -145,6 +142,9 @@ func (Pipe) Run(ctx *context.Context) error {
} }
func process(ctx *context.Context, docker config.Docker, artifacts []*artifact.Artifact) error { func process(ctx *context.Context, docker config.Docker, artifacts []*artifact.Artifact) error {
if len(artifacts) == 0 {
log.Warn("not binaries or packages found for the given platform - COPY/ADD may not work")
}
tmp, err := os.MkdirTemp(ctx.Config.Dist, "goreleaserdocker") tmp, err := os.MkdirTemp(ctx.Config.Dist, "goreleaserdocker")
if err != nil { if err != nil {
return fmt.Errorf("failed to create temporary dir: %w", err) return fmt.Errorf("failed to create temporary dir: %w", err)