1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-27 21:39:20 +02:00
Carlos Alexandro Becker 10c6df73c0
chore: more cleanup
2017-12-18 09:00:19 -02:00

21 lines
560 B
Go

// Package archiveformat provides functions to get the format of given package
// based on the config
// TODO: this can be moved inside the archive pipe package
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
}