You've already forked goreleaser
							
							
				mirror of
				https://github.com/goreleaser/goreleaser.git
				synced 2025-10-30 23:58:09 +02:00 
			
		
		
		
	chore: improving scoop code a bit
This commit is contained in:
		
				
					committed by
					
						 Carlos Alexandro Becker
						Carlos Alexandro Becker
					
				
			
			
				
	
			
			
			
						parent
						
							1376f9e226
						
					
				
				
					commit
					851fd76a5e
				
			| @@ -80,7 +80,8 @@ func doRun(ctx *context.Context, client client.Client) error { | ||||
| 		ctx.Config.Scoop.CommitAuthor, | ||||
| 		ctx.Config.Scoop.Bucket, | ||||
| 		content, | ||||
| 		path) | ||||
| 		path, | ||||
| 	) | ||||
| } | ||||
|  | ||||
| // Manifest represents a scoop.sh App Manifest, more info: | ||||
| @@ -109,17 +110,14 @@ func buildManifest(ctx *context.Context, client client.Client, artifacts []artif | ||||
| 	} | ||||
|  | ||||
| 	for _, artifact := range artifacts { | ||||
| 		if artifact.Goarch == "amd64" { | ||||
| 			manifest.Architecture["64bit"] = Resource{ | ||||
| 		var arch = "64bit" | ||||
| 		if artifact.Goarch == "386" { | ||||
| 			arch = "32bit" | ||||
| 		} | ||||
| 		manifest.Architecture[arch] = Resource{ | ||||
| 			URL: getDownloadURL(ctx, ctx.Config.GitHubURLs.Download, artifact.Name), | ||||
| 			Bin: ctx.Config.Builds[0].Binary + ".exe", | ||||
| 		} | ||||
| 		} else if artifact.Goarch == "386" { | ||||
| 			manifest.Architecture["32bit"] = Resource{ | ||||
| 				URL: getDownloadURL(ctx, ctx.Config.GitHubURLs.Download, artifact.Name), | ||||
| 				Bin: ctx.Config.Builds[0].Binary + ".exe", | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	data, err := json.MarshalIndent(manifest, "", "    ") | ||||
| @@ -127,15 +125,16 @@ func buildManifest(ctx *context.Context, client client.Client, artifacts []artif | ||||
| 		return | ||||
| 	} | ||||
| 	_, err = result.Write(data) | ||||
|  | ||||
| 	return | ||||
| } | ||||
|  | ||||
| func getDownloadURL(ctx *context.Context, githubURL, file string) (url string) { | ||||
| 	return fmt.Sprintf("%s/%s/%s/releases/download/%s/%s", | ||||
| func getDownloadURL(ctx *context.Context, githubURL, file string) string { | ||||
| 	return fmt.Sprintf( | ||||
| 		"%s/%s/%s/releases/download/%s/%s", | ||||
| 		githubURL, | ||||
| 		ctx.Config.Release.GitHub.Owner, | ||||
| 		ctx.Config.Release.GitHub.Name, | ||||
| 		ctx.Version, | ||||
| 		file) | ||||
| 		file, | ||||
| 	) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user