1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/pipeline/repos/repos.go

36 lines
644 B
Go
Raw Normal View History

2017-01-14 16:34:22 +02:00
package repos
import (
"strings"
2017-01-15 00:01:32 +02:00
"github.com/goreleaser/goreleaser/context"
2017-01-14 16:34:22 +02:00
)
// Pipe for brew deployment
type Pipe struct{}
2017-01-14 20:41:32 +02:00
// Description of the pipe
2017-01-14 19:14:35 +02:00
func (Pipe) Description() string {
return "Filling repositories data..."
2017-01-14 16:34:22 +02:00
}
// Run the pipe
2017-01-14 18: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 18: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 16:34:22 +02:00
return
}
func split(pair string) (string, string) {
parts := strings.Split(pair, "/")
return parts[0], parts[1]
}