mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-04-13 11:50:34 +02:00
feat: --skip=nfpm
This commit is contained in:
parent
90a1bbe8bb
commit
5e9f01e6ea
@ -38,7 +38,9 @@ const (
|
||||
type Pipe struct{}
|
||||
|
||||
func (Pipe) String() string { return "linux packages" }
|
||||
func (Pipe) Skip(ctx *context.Context) bool { return len(ctx.Config.NFPMs) == 0 }
|
||||
func (Pipe) Skip(ctx *context.Context) bool {
|
||||
return skips.Any(ctx, skips.NFPM) || len(ctx.Config.NFPMs) == 0
|
||||
}
|
||||
|
||||
// Default sets the pipe defaults.
|
||||
func (Pipe) Default(ctx *context.Context) error {
|
||||
|
@ -1407,6 +1407,14 @@ func TestSkip(t *testing.T) {
|
||||
t.Run("skip", func(t *testing.T) {
|
||||
require.True(t, Pipe{}.Skip(testctx.New()))
|
||||
})
|
||||
t.Run("skip flag", func(t *testing.T) {
|
||||
ctx := testctx.NewWithCfg(config.Project{
|
||||
NFPMs: []config.NFPM{
|
||||
{},
|
||||
},
|
||||
}, testctx.Skip(skips.NFPM))
|
||||
require.True(t, Pipe{}.Skip(ctx))
|
||||
})
|
||||
|
||||
t.Run("dont skip", func(t *testing.T) {
|
||||
ctx := testctx.NewWithCfg(config.Project{
|
||||
|
@ -29,6 +29,7 @@ const (
|
||||
Homebrew Key = "homebrew"
|
||||
Nix Key = "nix"
|
||||
AUR Key = "aur"
|
||||
NFPM Key = "nfpm"
|
||||
)
|
||||
|
||||
func String(ctx *context.Context) string {
|
||||
@ -109,6 +110,7 @@ var Release = Keys{
|
||||
Homebrew,
|
||||
Nix,
|
||||
AUR,
|
||||
NFPM,
|
||||
Before,
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user