I looked around for this and couldn't find it. Before venturing into coding it, I thought I'd ask…

I regularly update my mac via terminal with brew, macports, pip, yarn, etc. So I started reinstalling my apps via brew cask so they get regularly updated. It's pretty mechanical, and I'm sure there's a way to automate it. All it'd need to do is ls the apps in the Applications folder, compare it to the brew cask list, and brew cask --force install those not already there. A more rounded script would use brew search and ask the user to pick and confirm if results were ambivalent.



cd /Applications
brew cask list -1 > apps.txt
brew search --casks > casks.txt
for f in *.app do
    if grep -Fixq ${${f%.*}// /-} casks.txt && ! grep -Fixq ${${f%.*}// /-} apps.txt
        then HOMEBREW_NO_AUTO_UPDATE=1 brew cask install --force ${${f%.*}// /-}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.