Brew cask: I would like to check if the package/formula is already installed through brew or other means

I am trying to install some softwares using brew cask and I would like to check if the package/formula is already installed through brew or other means

I have a script that installs a list of softwares using brew cask and I dont want it to install a software that is already present on the machine

To achive this I referred to this question: With Homebrew, how to check if a software/package is installed?

This is pointed me in the right direction but I can only avoid installing software that is installed via brew cask.

If the software is installed by downloading the dmg and is already present in the /Applications/ folder then it does not recognize that and it continues to install the software.

Is there a way to figure out if the application is installed via brew or any other means before my script starts installing it


I assume you know the name of the application. Then just test for existence of the application

if [[ ! -d "/Applications/APP-TO-CHECK.app" ]]; then
    # install APP-TO-CHECK
fi 

This is a primitive solution but it might help.

  1. Download this app (it allows you to search hidden files.)
  2. Search for the name of your application/repo you want to download.
  3. If it is not there, then it is safe to say you don't have it.