diff --git a/README.md b/README.md index dec42d53d..fc57c7294 100644 --- a/README.md +++ b/README.md @@ -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" ``` diff --git a/config/config.go b/config/config.go index bcdbbf22d..da31b4eb2 100644 --- a/config/config.go +++ b/config/config.go @@ -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 } diff --git a/pipeline/brew/brew.go b/pipeline/brew/brew.go index 5927d92a2..69d329779 100644 --- a/pipeline/brew/brew.go +++ b/pipeline/brew/brew.go @@ -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 {