not ever sh script better with set -e
sudo for chmod on usr/local for brew
brew can check if formula installed by self