only search non-system paths
parent
137346974a
commit
2374f389b4
|
|
@ -7,17 +7,19 @@ _command_exists git || return
|
||||||
complete -p git &>/dev/null && return
|
complete -p git &>/dev/null && return
|
||||||
|
|
||||||
_git_bash_completion_paths=(
|
_git_bash_completion_paths=(
|
||||||
# Linux
|
# MacOS non-system locations
|
||||||
'/etc/bash_completion.d/git.sh'
|
|
||||||
'/usr/share/bash-completion/completions/git'
|
|
||||||
# MacOS
|
|
||||||
'/Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash'
|
'/Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash'
|
||||||
'/Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash'
|
'/Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash'
|
||||||
)
|
)
|
||||||
|
|
||||||
for fn in "${_git_bash_completion_paths[@]}" ; do
|
for _comp_path in "${_git_bash_completion_paths[@]}" ; do
|
||||||
if [ -r "$fn" ] ; then
|
if [ -r "$_comp_path" ] ; then
|
||||||
source "$fn"
|
source "$_comp_path"
|
||||||
break
|
unset _git_bash_completion_paths
|
||||||
|
return
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
unset _git_bash_completion_paths
|
||||||
|
|
||||||
|
(_log_warning "no completion files found - please try enabling the 'system' completion instead." && return 1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue