1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-18 03:56:52 +02:00

create brew formulae in a subfolder

This commit is contained in:
Carlos Alexandro Becker 2017-01-14 11:18:48 -02:00
parent 8cbae9856c
commit 9908fec4aa
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940
3 changed files with 4 additions and 2 deletions

View File

@ -55,6 +55,7 @@ repo: user/repo
binary_name: my-binary
brew:
repo: user/homebrew-tap
folder: optional/subfolder/inside/the/repo
caveats: "Optional caveats to add to the formulae"
```

View File

@ -16,6 +16,7 @@ var filePatterns = []string{"LICENCE*", "LICENSE*", "README*", "CHANGELOG*"}
// Homebrew contains the brew section
type Homebrew struct {
Repo string
Folder string
Token string `yaml:"-"`
Caveats string
}

View File

@ -4,6 +4,7 @@ import (
"bytes"
"context"
"log"
"path/filepath"
"strings"
"text/template"
@ -58,8 +59,7 @@ func (Pipe) Run(config config.ProjectConfig) error {
client := github.NewClient(tc)
owner, repo := split.OnSlash(config.Brew.Repo)
path := config.BinaryName + ".rb"
path := filepath.Join(config.Brew.Folder, config.BinaryName+".rb")
log.Println("Updating", path, "on", config.Brew.Repo, "...")
out, err := buildFormulae(config, client)
if err != nil {