1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-09-16 09:26: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
3 changed files with 4 additions and 2 deletions

View File

@@ -55,6 +55,7 @@ repo: user/repo
binary_name: my-binary binary_name: my-binary
brew: brew:
repo: user/homebrew-tap repo: user/homebrew-tap
folder: optional/subfolder/inside/the/repo
caveats: "Optional caveats to add to the formulae" 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 // Homebrew contains the brew section
type Homebrew struct { type Homebrew struct {
Repo string Repo string
Folder string
Token string `yaml:"-"` Token string `yaml:"-"`
Caveats string Caveats string
} }

View File

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