This won't accommodate non-/usr/local installs of Homebrew. Perhaps you can add in something like @@HOMEBREW_PREFIX@@ in the first entry that can be updated via inreplace in the install method?