Skip to content

Commit

Permalink
.bash_profile: Update bash-completion sourcing (#864)
Browse files Browse the repository at this point in the history
The previous sourcing is replaced with what the current “caveats” specify (see `brew info bash-completion@2`).

And, thanks to Homebrew/homebrew-core#36254, any bash-completions meant for bash-completion v1 are now included, thanks to the environment variable.
  • Loading branch information
jeffbyrnes authored and mathiasbynens committed Apr 25, 2019
1 parent 307c635 commit 5368015
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .bash_profile
Expand Up @@ -26,8 +26,10 @@ for option in autocd globstar; do
done;

# Add tab completion for many Bash commands
if which brew &> /dev/null && [ -f "$(brew --prefix)/share/bash-completion/bash_completion" ]; then
source "$(brew --prefix)/share/bash-completion/bash_completion";
if which brew &> /dev/null && [ -r "$(brew --prefix)/etc/profile.d/bash_completion.sh" ]; then
# Ensure existing Homebrew v1 completions continue to work
export BASH_COMPLETION_COMPAT_DIR="$(brew --prefix)/etc/bash_completion.d";
source "$(brew --prefix)/etc/profile.d/bash_completion.sh";
elif [ -f /etc/bash_completion ]; then
source /etc/bash_completion;
fi;
Expand Down

0 comments on commit 5368015

Please sign in to comment.