In case you want to see the contents of your Brewfile use cat
Below is just an example of how a Brewfile would look like
Yours will look different
1
cat /tmp/brew-dump-test/Brewfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
linkarzu.@.mini~/github/dotfiles-latest on main via 💎 v3.1.3
[24/02/02 07:47:41]
❯ cat /tmp/brew-dump-test/Brewfile
tap "homebrew/bundle"
tap "homebrew/cask-fonts"
tap "homebrew/services"
tap "jesseduffield/lazygit"
tap "koekeishiya/formulae"
brew "automake"
brew "openssl@3"
brew "bat"
brew "bind"
brew "bison"
brew "chruby"
brew "eza"
brew "fd"
brew "figlet"
brew "fontconfig"
Alternatively, if you want to save the Brewfile in the current directory don’t specify the path
1
brew bundle dump
Inspect the Brewfile so you can see the apps
Install the apps listed in a Brewfile
To install the apps listed in the Brewfile
Don’t run the below command yet, we’ll install the apps we need shortly
But this will be useful when you need to install apps using your own file
1
brew bundle --file=/tmp/brew-dump-test/Brewfile
Alternatively, if you are in the same directory where the Brewfile is, you can just run the command
Don’t run it just yet, we will install the apps we need from GitHub below
1
brew bundle
How do I create a brewfile with my own apps?
In the previous video we saw how to install apps
Go and check that video if you have doubts
So if this is your first time installing brew apps, you have to manually install the apps one by one, searching for the correct commands in the https://formulae.brew.sh page
Once you have all the apps that you want, you generate your Brewfile following the steps in the How to generate a Brewfile section above
Do I need to store this Brewfile in github?
No, you can store a Brewfile that you have generated anywhere you want, when you need it, just download it and then install the apps listed in that file with the steps provided in the section above Install the apps listed in a Brewfile
Install apps from a brewfile hosted in github
We’ll install the apps I use as a base, which are needed for this video series
The following command gets the contents of my Brewfile in github, and passes it directly to the brew bundle command. A local Brewfile won’t be created in your computer
In the video you will see I use my old and now unmaintained dotfiles-public repo.
The repo that is now maintained and up to date is dotfiles-latest.
All the commands in the blogpost are updated and point to the newdotfiles-latest repo.
If you encounter any issues or outdated parts, let me know
Some apps have caveats that need to be taken care of so they work
The caveats for each one of the apps I use, are already taken care of by my zshrc file, this is found on a later video related to my dotfiles
1
brew list
1
2
3
4
5
6
7
brew info zsh-autosuggestions
brew info zsh-vi-mode
# Not all the apps will show the install insctructions, but they can be found# on the install page for each app. For example:# https://starship.rs/guide/#🚀-installation
brew info starship
See all the caveats using a script
This section below is optional, doesn’t need to be done, but it’s good for learning or if you want to understand what’s going on
If you want to check the caveats for each one of the installed apps, there’s a script I found below:
# This loop will go through each installed Homebrew packagefor cmd in$(brew list);do# This line checks if there are any caveats for the current package# 'grep -q' suppresses the output and just returns an exit status# If caveats exist, the exit status will be 0 (success), triggering the if blockif brew info $cmd | grep-q Caveats;then# This line will print the name of the current package followed by a newlineecho"$cmd\n";# This line prints the caveats for the current package# The 'sed' command is used to print only the lines between '==> Caveats'# and the next '==>' line# The '/!d' at the end deletes all lines not matching the pattern, leaving# only the caveats# The '//d' deletes the 'Caveats' and next '==>' line itself
brew info $cmd | sed'/==> Caveats/,/==>/!d;//d';# This line prints a 40-character long string of dashes# It's used to visually separate the caveats for different packagesprintf'%40s\n' | tr' ' -;fi;done;
This will not fix the caveats, just show them to you so you can fix them manually.
Don’t worry about the caveats, we’ll fix them in my dotfiles video
Community-driven promotion
Do you want to promote yourself in my channel? I’m not talking about a company like notion, brilliant, and all those other ones we’re using to seeing. I’m talking about you as a person, do you have a project, course, youtube channel or product and trying to reach an audience?
If interested, pricing and all the details can be found in this other page
You’re a fraud, why do you ask for money, isn’t YouTube Ads enough?
I explain all of this in the “about me page” link below: