Merge pull request #6105 from mroth/patch-1
speedup bash completion loading suggestion in docs
This commit is contained in:
commit
039885c95d
@ -11,14 +11,15 @@ You must configure your shell to enable the completion support. This is because
|
|||||||
To make Homebrew's completions available in `bash`, you must source the definitions as part of your shell startup. Add the following to your `~/.bash_profile` file:
|
To make Homebrew's completions available in `bash`, you must source the definitions as part of your shell startup. Add the following to your `~/.bash_profile` file:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
HOMEBREW_PREFIX=$(brew --prefix)
|
||||||
if type brew &>/dev/null; then
|
if type brew &>/dev/null; then
|
||||||
for COMPLETION in $(brew --prefix)/etc/bash_completion.d/*
|
for COMPLETION in "$HOMEBREW_PREFIX"/etc/bash_completion.d/*
|
||||||
do
|
do
|
||||||
[[ -f $COMPLETION ]] && source "$COMPLETION"
|
[[ -f $COMPLETION ]] && source "$COMPLETION"
|
||||||
done
|
done
|
||||||
if [[ -f $(brew --prefix)/etc/profile.d/bash_completion.sh ]];
|
if [[ -f ${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh ]];
|
||||||
then
|
then
|
||||||
source "$(brew --prefix)/etc/profile.d/bash_completion.sh"
|
source "${HOMEBREW_PREFIX}/etc/profile.d/bash_completion.sh"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
```
|
```
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user