1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-25 21:29:14 +02:00

fix: Trim trailing slash from Gitea URL (#3488)

This PR will truncate any trailing slash left by specifying only a Gitea
API URL.

Fixes #3487

I have not added any tests for this.

Signed-off-by: Sam Therapy <sam@samtherapy.net>
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Sam Therapy 2022-10-22 01:42:19 +00:00 committed by GitHub
parent f1e63050d6
commit 154c520755
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,7 +35,7 @@ func (Pipe) Run(ctx *context.Context) error {
return fmt.Errorf("templating Gitea API URL: %w", err)
}
ctx.Config.GiteaURLs.Download = strings.ReplaceAll(apiURL, "/api/v1", "")
ctx.Config.GiteaURLs.Download = strings.TrimSuffix(strings.ReplaceAll(apiURL, "/api/v1", ""), "/")
}
for _, defaulter := range defaults.Defaulters {
if err := errhandler.Handle(defaulter.Default)(ctx); err != nil {