1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-26 04:22:05 +02:00
Jorin Vogel 809cb682d2 Merge branch 'master' of https://github.com/goreleaser/goreleaser into tag-only
* 'master' of https://github.com/goreleaser/goreleaser:
  fixed name on --help
  removed unneeded pointers from context
2017-01-19 10:30:47 +01:00

39 lines
681 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 "Setting repositories"
}
// 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, "/")
if len(parts) == 1 {
return parts[0], ""
}
return parts[0], parts[1]
}