1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2024-12-31 01:53:50 +02:00
goreleaser/internal/archiveformat/format.go
2017-07-02 12:02:20 -03:00

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
}