1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2024-12-27 01:33:39 +02:00

fix: debug skip

Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
Carlos Alexandro Becker 2021-09-18 10:25:28 -03:00
parent 61bead8989
commit a8a3061fe9
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -2,6 +2,9 @@
package skip
import (
"fmt"
"github.com/apex/log"
"github.com/goreleaser/goreleaser/internal/middleware"
"github.com/goreleaser/goreleaser/pkg/context"
)
@ -10,6 +13,8 @@ import (
type Skipper interface {
// Skip returns true if the Piper should be skipped.
Skip(ctx *context.Context) bool
fmt.Stringer
}
// Maybe returns an action that skips immediately if the given p is a Skipper
@ -18,6 +23,7 @@ func Maybe(skipper interface{}, next middleware.Action) middleware.Action {
if skipper, ok := skipper.(Skipper); ok {
return func(ctx *context.Context) error {
if skipper.Skip(ctx) {
log.Debugf("skipped %s", skipper.String())
return nil
}
return next(ctx)