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

36 lines
644 B
Go

package repos
import (
"strings"
"github.com/goreleaser/goreleaser/context"
)
// Pipe for brew deployment
type Pipe struct{}
// Description of the pipe
func (Pipe) Description() string {
return "Filling repositories data..."
}
// Run the pipe
func (Pipe) Run(ctx *context.Context) (err error) {
owner, name := split(ctx.Config.Release.Repo)
ctx.ReleaseRepo = &context.Repo{
Owner: owner,
Name: name,
}
owner, name = split(ctx.Config.Brew.Repo)
ctx.BrewRepo = &context.Repo{
Owner: owner,
Name: name,
}
return
}
func split(pair string) (string, string) {
parts := strings.Split(pair, "/")
return parts[0], parts[1]
}