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) {
|
2017-01-14 23:47:15 +02:00
|
|
|
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]
|
|
|
|
}
|