Skip to content

Commit

Permalink
fix: debug skip
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
  • Loading branch information
caarlos0 committed Sep 18, 2021
1 parent 61bead8 commit a8a3061
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/middleware/skip/skip.go
Expand Up @@ -2,6 +2,9 @@
package skip

import (
"fmt"

"github.com/apex/log"
"github.com/goreleaser/goreleaser/internal/middleware"
"github.com/goreleaser/goreleaser/pkg/context"
)
Expand All @@ -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
Expand All @@ -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)
Expand Down

1 comment on commit a8a3061

@vercel
Copy link

@vercel vercel bot commented on a8a3061 Sep 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.