mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
completions/brew: Protect against pathname expansions and refactor
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
if which brew >/dev/null 2>&1; then
|
||||
if [ -f `brew --prefix`/etc/bash_completion ]; then
|
||||
. `brew --prefix`/etc/bash_completion
|
||||
fi
|
||||
if _omb_util_command_exists brew; then
|
||||
_omb_completion_brew_prefix=$(brew --prefix)
|
||||
if [[ $_omb_completion_brew_prefix ]]; then
|
||||
if [[ -f $_omb_completion_brew_prefix/etc/bash_completion ]]; then
|
||||
source "$_omb_completion_brew_prefix"/etc/bash_completion
|
||||
fi
|
||||
|
||||
if [ -f `brew --prefix`/Library/Contributions/brew_bash_completion.sh ]; then
|
||||
. `brew --prefix`/Library/Contributions/brew_bash_completion.sh
|
||||
if [[ -f $_omb_completion_brew_prefix/Library/Contributions/brew_bash_completion.sh ]]; then
|
||||
source "$_omb_completion_brew_prefix"/Library/Contributions/brew_bash_completion.sh
|
||||
fi
|
||||
fi
|
||||
unset -v _omb_completion_brew_prefix
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user