How can I implement install-or-upgrade for brew recipes?
问题 I want to install a brew recipe or upgrade it if is already installed using bash. The command is supposed to return a non zero exit code only if at the end the recipe is not installed. PS. One should remark the brew install xxx return error code if xxx is already installed. 回答1: Background: https://github.com/Homebrew/legacy-homebrew/issues/30939 I just needed this also. This seems to work. #!/usr/bin/env bash package=$1 pkg_installed=false pkg_updated=false verbose=true # TODO: ensure valid