elif [ -r /etc/bash_completion ]; then
_BASH_COMPLETIONS_DIR=/etc/bash_completion.d
. /etc/bash_completion
- elif [ -d /etc/bash_completion.d ]; then
+ elif [ -d /etc/bash_completion.d ] &&
+ [ -n "`ls -A /etc/bash_completion.d`" ]; then
_BASH_COMPLETIONS_DIR=/etc/bash_completion.d
for _compf in /etc/bash_completion.d/*; do
. $_compf
done
- elif [ -d /usr/local/etc/bash_completion.d ]; then
+ elif [ -d /usr/local/etc/bash_completion.d ] &&
+ [ -n "`ls -A /usr/local/etc/bash_completion.d`" ]; then
_BASH_COMPLETIONS_DIR=/usr/local/etc/bash_completion.d
for _compf in /usr/local/etc/bash_completion.d/*; do
. $_compf
! has_completion $cmd && complete -A function -A variable $cmd
done
-if [ -d "$HOME"/.bash_completion.d ]; then
+if [ -d "$HOME"/.bash_completion.d -a \
+ -n "`ls -A $HOME/.bash_completion.d`" ]; then
for _compf in "$HOME"/.bash_completion.d/*; do
. $_compf
done