Recommended way to install a set of formulae?

(Henry Bley-Vroman) #1

I’m working on a set of tools each of which will be in its own repo. I want to make them all available for download with a single command, like brew install all-my-formulae. Is there a recommended way to do this?

Right now I list each formula as a dependency, and then install a file to doc to prevent the install from being empty.

class AllMyFormulae < Formula
  desc "All of my formulae"
  homepage "…"
  url "….tar.gz"
  sha256 "…"

  depends_on "one"
  depends_on "two"
  depends_on "three"
  ...(more dependencies)…

  def install
    doc.install ""

  test do

(I would prefer to automate this over telling users to brew install one two three etc. Might end up going with a monorepo or submodules in the end, but I’m still interested in this approach.)


(Sean Molenaar) #2

Brew bundle is meant for exactly this usecase.


(Henry Bley-Vroman) #3

Interesting, my use of brew bundle has been for installing a set of things which aren’t [edit: I initially typo’d as “are” :open_mouth: ] inherently related — for example a project’s dependencies. Could be a good fourth option if there was support for the inverse of cleanup, uninstalling everything in the Brewfile.


(Sean Molenaar) #4

Depending on how much effort you want to put in, you could make a new option to cleanup and make a pull request for it. Or you can dump all installed formula and remove all formula in a blacklist.