diff --git a/internal/pipe/scoop/scoop.go b/internal/pipe/scoop/scoop.go index 5ed311e91..1050a98b5 100644 --- a/internal/pipe/scoop/scoop.go +++ b/internal/pipe/scoop/scoop.go @@ -35,6 +35,9 @@ func (Pipe) Run(ctx *context.Context) error { // Default sets the pipe defaults func (Pipe) Default(ctx *context.Context) error { + if ctx.Config.Scoop.Name == "" { + ctx.Config.Scoop.Name = ctx.Config.ProjectName + } if ctx.Config.Scoop.CommitAuthor.Name == "" { ctx.Config.Scoop.CommitAuthor.Name = "goreleaserbot" } @@ -70,7 +73,7 @@ func doRun(ctx *context.Context, client client.Client) error { return ErrNoWindows } - path := ctx.Config.ProjectName + ".json" + var path = ctx.Config.Scoop.Name + ".json" content, err := buildManifest(ctx, archives) if err != nil { @@ -142,7 +145,7 @@ func buildManifest(ctx *context.Context, artifacts []artifact.Artifact) (bytes.B manifest.Architecture[arch] = Resource{ URL: url, - Bin: ctx.Config.Builds[0].Binary + ".exe", + Bin: ctx.Config.Builds[0].Binary + ".exe", // TODO: this is wrong Hash: sum, } } diff --git a/internal/pipe/scoop/scoop_test.go b/internal/pipe/scoop/scoop_test.go index 23cb63b4e..52cfc11fb 100644 --- a/internal/pipe/scoop/scoop_test.go +++ b/internal/pipe/scoop/scoop_test.go @@ -31,6 +31,7 @@ func TestDefault(t *testing.T) { var ctx = &context.Context{ Config: config.Project{ + ProjectName: "barr", Builds: []config.Build{ { Binary: "foo", @@ -54,6 +55,7 @@ func TestDefault(t *testing.T) { }, } assert.NoError(t, Pipe{}.Default(ctx)) + assert.Equal(t, ctx.Config.ProjectName, ctx.Config.Scoop.Name) assert.NotEmpty(t, ctx.Config.Scoop.CommitAuthor.Name) assert.NotEmpty(t, ctx.Config.Scoop.CommitAuthor.Email) } diff --git a/pkg/config/config.go b/pkg/config/config.go index 5d2365218..9563f0726 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -55,6 +55,7 @@ type Homebrew struct { // Scoop contains the scoop.sh section type Scoop struct { + Name string `yaml:",omitempty"` Bucket Repo `yaml:",omitempty"` CommitAuthor CommitAuthor `yaml:"commit_author,omitempty"` Homepage string `yaml:",omitempty"`