Brew cask: I would like to check if the package/formula is already installed through brew or other means
I assume you know the name of the application. Then just test for existence of the application
if [[ ! -d &quot;/Applications/APP-TO-CHECK.app&quot; ]]; then
    # install APP-TO-CHECK
fi