PACKAGE = brew list -versions $( 1 ) > /dev/null || brew install $( 1 )$( 2 ) CASK = brew cask list $( 1 ) > /dev/null 2> & 1 || brew cask install $( 1 ). Replacing Brewfile is a little more involved, but ends up working quite well. It’s all non-destructive: if you have a real file in your $HOME directory, It asks you for confirmation before unlinking anything. You can re-run make linkĪs you add new files to dotfiles/home. So, perhaps I got a little verbose in my explanation, but it ends up creatingĪ pretty simple Makefile and the result is very safe.
Link between the files in my dotfiles to my $HOME directory.īefore reading the Makefile below, know this: Replacing makup was easy for me because I was only using it for dot files that While Brewfile and mackup are great tools, they were not adding a lot of valueįor me and I realized that what they were doing was really simple and I could Up with some rather odd symlinking that would confuse the heck out of me if I had It was due to how infrequently I actually used it, so I would forget how it worksĪnd what commands I should use.
For example, if I upgrade macOS, I need to re-install my ports andĪnd Brewfile is not practical for this because it includes things like casks Brewfile is sort of an all or nothing type system.Really liked it, but then I ran into some problems: Using Brewfile and mackup to do most of the heavy lifting. I was originally inspired by this dotfiles On my system, this command returned /usr/local, the place where the Cellar folder can be found.Using a Makefile for your dotfiles can help simplify your dot file life!
If you don’t find this folder, run brew -prefix to find the correct folder prefix. Packages installed using Homebrew are all installed in a specific folder. Make sure you read everything Homebrew prints to the console, to avoid headaches later. If this is the case, those are typically highlighted to you at the end of the installation process.
Sometimes packages (like the mysql package I used in the example above) will install, but they will require some additional steps before you can run them. You might never need any of those options - I very rarely use anything else than the default brew install. The command has a lot of options available, and you can check them out