1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-07-11 01:20:21 +02:00
Files
goreleaser/pipeline/repos/repos.go

36 lines
644 B
Go
Raw Normal View History

2017-01-14 12:34:22 -02:00
package repos
import (
"strings"
2017-01-14 20:01:32 -02:00
"github.com/goreleaser/goreleaser/context"
2017-01-14 12:34:22 -02:00
)
// Pipe for brew deployment
type Pipe struct{}
2017-01-14 19:41:32 +01:00
// Description of the pipe
2017-01-14 15:14:35 -02:00
func (Pipe) Description() string {
return "Filling repositories data..."
2017-01-14 12:34:22 -02:00
}
// Run the pipe
2017-01-14 14:06:57 -02:00
func (Pipe) Run(ctx *context.Context) (err error) {
owner, name := split(ctx.Config.Release.Repo)
ctx.ReleaseRepo = &context.Repo{
2017-01-14 14:06:57 -02:00
Owner: owner,
Name: name,
}
owner, name = split(ctx.Config.Brew.Repo)
ctx.BrewRepo = &context.Repo{
Owner: owner,
Name: name,
}
2017-01-14 12:34:22 -02:00
return
}
func split(pair string) (string, string) {
parts := strings.Split(pair, "/")
return parts[0], parts[1]
}