caskroom/homebrew-cask — pull request #7481 by dpeek (2014-11-20 13:27:40+00:00)
Title: Binaries should install to HOMEBREW_PREFIX

I was trying to use brew cask to install apps with boxen. Sublime Text fails to install as boxen uses a custom HOMEBREW_PREFIX (`/opt/boxen/homebrew`) which brew cask ignores when linking the `subl` binary.

Installation fails with `Error: Permission denied - /usr/local` because `/usr/local` does not exist.

This minor patch returns the correct binary directory based on the current prefix.