fix zsh syntax warning and check for `brew`