Open sanman1k98 opened 2 years ago
Need to investigate: using multiple Brewfiles.
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
.
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 likenvim
or my terminal emulator of choice, kitty.To output all your installed dependencies to a file
Run
brew bundle dump
to write aBrewfile
in your current directory.--force
to overwrite an existingBrewfile
--describe
will add a comment above each line unless the dependency does not have a description--file=/path/to/Brewfile
to specify the path location--global
will use~/.Brewfile
HOMEBREW_BUNDLE_FILE
environment variable to specify the locationTo install the dependencies from that file
Run
brew bundle install
to read the dependancies from theBrewfile
in your current directory and install and upgrade them. If all dependencies are installed successfully, it will output aBrewfile.lock.json
in the same directory as theBrewfile
HOMEBREW_BUNDLE_FILE
if you have it set--file
with a path will change the location to wherever you specify--global
will read from~/.Brewfile
--no-lock
will not output aBrewfile.lock.json
HOMEBREW_BUNDLE_NO_LOCK
environment variable to opt-out of writing aBrewfile.lock.json
Some Ideas or TODOs
HOMEBREW_BUNDLE_FILE
variable in.zshenv
be~/.config/brew/
or something like thatBrewfile.lock.json
and see if I really need itbrew bundle install
to the amazing install script that I'm gonna figure out how to write someday