1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-22 04:08:49 +02:00

fix: winget paths on windows (#4786)

closes  #4785
This commit is contained in:
Carlos Alexandro Becker 2024-04-16 20:57:22 -03:00 committed by GitHub
parent 5d37c9a5a0
commit 1ed1a62b90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 3 deletions

View File

@ -3,6 +3,7 @@ package winget
import ( import (
"fmt" "fmt"
"os" "os"
"path"
"path/filepath" "path/filepath"
"strings" "strings"
@ -20,7 +21,7 @@ func createYAML(ctx *context.Context, winget config.Winget, in any, tp artifact.
} }
filename := winget.PackageIdentifier + extFor(tp) filename := winget.PackageIdentifier + extFor(tp)
path := filepath.Join(ctx.Config.Dist, "winget", winget.Path, filename) path := path.Join(ctx.Config.Dist, "winget", winget.Path, filename)
if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil { if err := os.MkdirAll(filepath.Dir(path), 0o755); err != nil {
return err return err
} }

View File

@ -3,6 +3,7 @@ package winget
import ( import (
"fmt" "fmt"
"os" "os"
"path"
"path/filepath" "path/filepath"
"regexp" "regexp"
"strings" "strings"
@ -161,7 +162,7 @@ func (p Pipe) doRun(ctx *context.Context, winget config.Winget, cl client.Releas
} }
if winget.Path == "" { if winget.Path == "" {
winget.Path = filepath.Join("manifests", strings.ToLower(string(winget.Publisher[0])), winget.Publisher, winget.Name, ctx.Version) winget.Path = path.Join("manifests", strings.ToLower(string(winget.Publisher[0])), winget.Publisher, winget.Name, ctx.Version)
} }
filters := []artifact.Filter{ filters := []artifact.Filter{
@ -300,7 +301,7 @@ func doPublish(ctx *context.Context, cl client.Client, wingets []*artifact.Artif
} }
files = append(files, client.RepoFile{ files = append(files, client.RepoFile{
Content: content, Content: content,
Path: filepath.Join(winget.Path, pkg.Name), Path: path.Join(winget.Path, pkg.Name),
Identifier: repoFileID(pkg.Type), Identifier: repoFileID(pkg.Type),
}) })
} }