I am writing a script to setup a mac development environment, however I am running into an issue on some peoples macs where cask does not install. Is there a way I can verify if cask has been installed in bash?

Ideally I am looking for something like:

if caskIsInstalled then
     # do stuff...
  • 1
    Does this help?
    – Arthur
    Commented Oct 13, 2015 at 11:05
  • @ArthurHammer A bit, but it did not take me far enough.
    – Rylander
    Commented Oct 13, 2015 at 15:25

1 Answer 1


I ended up asking this on stackoverflow, where I was able to come up with this.

if ! brew info cask &>/dev/null; then
  echo "Failed to install Cask (Homebrew Extension)"
  exit 1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .