Here is what I learned so far:
# settings on mac
if [[ $(uname) == "Darwin" ]]; then
# enable bash completion
if [ -f `brew --prefix`/etc/bash_completion ]; then
. `brew --prefix`/etc/bash_completion
fi
# enable git completion
if [ -f `brew --prefix`/etc/bash_completion.d/git-completion.bash ]; then
. `brew --prefix`/etc/bash_completion.d/git-completion.bash
fi
fi
What if I have multiple scripts in `brew --prefix`/etc/bash_completion.d/
? How can I enable all of them?
Or, is there a folder in OS X equivalent to /etc/bash_completion.d/
in linux?
bash_completion
that you're sourcing handles the sourcing of the individual files from thebash_completion.d
directory.