sanman1k98 / dotfiles

Apache License 2.0
2 stars 0 forks source link

Using `brew bundle` effectively #15

Open sanman1k98 opened 2 years ago

sanman1k98 commented 2 years ago

Homebrew has official support for an external command: bundle. It can be used to write all installed casks, formulae, taps, fonts, etc into a Brewfile. That file can then be read from to install a bunch of programs. I use it so I can quickly install a bunch of apps and CLI programs that I use all the time like nvim or my terminal emulator of choice, kitty.

To output all your installed dependencies to a file

Run brew bundle dump to write a Brewfile in your current directory.

To install the dependencies from that file

Run brew bundle install to read the dependancies from the Brewfile in your current directory and install and upgrade them. If all dependencies are installed successfully, it will output a Brewfile.lock.json in the same directory as the Brewfile


Some Ideas or TODOs

sanman1k98 commented 2 years ago

Need to investigate: using multiple Brewfiles.

sanman1k98 commented 1 year ago

By default, brew list will output all installed formulae and casks regardless of whether they were installed only as a dependency of another formula. To list out formulae that were installed manually, use brew leaves -r or brew leaves --installed-on-request.