mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-03 13:11:48 +02:00
20 lines
501 B
Go
20 lines
501 B
Go
|
// Package archiveformat provides functions to get the format of given package
|
||
|
// based on the config
|
||
|
package archiveformat
|
||
|
|
||
|
import (
|
||
|
"strings"
|
||
|
|
||
|
"github.com/goreleaser/goreleaser/context"
|
||
|
)
|
||
|
|
||
|
// For return the archive format, considering overrides and all that
|
||
|
func For(ctx *context.Context, platform string) string {
|
||
|
for _, override := range ctx.Config.Archive.FormatOverrides {
|
||
|
if strings.HasPrefix(platform, override.Goos) {
|
||
|
return override.Format
|
||
|
}
|
||
|
}
|
||
|
return ctx.Config.Archive.Format
|
||
|
}
|