You've already forked goreleaser
							
							
				mirror of
				https://github.com/goreleaser/goreleaser.git
				synced 2025-10-30 23:58:09 +02:00 
			
		
		
		
	feat: scoop: accept name/project name (#811)
* feat: scoop: accept name/project name * fix: added todo to fix an issue
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							08e0830979
						
					
				
				
					commit
					aded99f621
				
			| @@ -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, | ||||
| 		} | ||||
| 	} | ||||
|   | ||||
| @@ -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) | ||||
| } | ||||
|   | ||||
| @@ -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"` | ||||
|   | ||||
		Reference in New Issue
	
	Block a user