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:
parent
61bead8989
commit
a8a3061fe9
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user