Merge pull request #6523 from petdance/patch-1

bash completion example should not call brew if brew doesn't exist
This commit is contained in:
Mike McQuaid 2019-10-12 21:09:32 +01:00 committed by GitHub
commit 16d477c696
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,8 +11,8 @@ You must configure your shell to enable its completion support. This is because
To make Homebrew's completions available in `bash`, you must source the definitions as part of your shell's startup. Add the following to your `~/.bash_profile` file:
```sh
HOMEBREW_PREFIX=$(brew --prefix)
if type brew &>/dev/null; then
HOMEBREW_PREFIX="$(brew --prefix)"
if [[ -r "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh" ]]; then
source "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh"
else