I found it surprisingly hard to make brew
either install a package (if it is missing) or upgrade it (if it is already installed). Is there no simple command / arguments to do that?
Based on this answer, I ended up doing (at the example of the git
package)
brew ls --versions git && brew upgrade git || brew install git
after doing a brew update
, obviously. However, that still seems clumsy to me compared to other package managers.