Use _bash_it_homebrew_check() in plugins, completions
Use new function `_bash_it_homebrew_check()` in existing plugins and completions which look for Homebrew. Alsö, use `$OSTYPE` instead of calling external `uname` binary.
This commit is contained in:
@@ -3,8 +3,8 @@ about-plugin 'Autojump configuration, see https://github.com/wting/autojump for
|
||||
|
||||
# Only supports the Homebrew variant, Debian and Arch at the moment.
|
||||
# Feel free to provide a PR to support other install locations
|
||||
if command -v brew &>/dev/null && [[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]]; then
|
||||
. $(brew --prefix)/etc/profile.d/autojump.sh
|
||||
if _bash_it_homebrew_check && [[ -s "${BASH_IT_HOMEBREW_PREFIX}/etc/profile.d/autojump.sh" ]]; then
|
||||
. "${BASH_IT_HOMEBREW_PREFIX}/etc/profile.d/autojump.sh"
|
||||
elif command -v dpkg &>/dev/null && dpkg -s autojump &>/dev/null ; then
|
||||
. "$(dpkg-query -S autojump.sh | cut -d' ' -f2)"
|
||||
elif command -v pacman &>/dev/null && pacman -Q autojump &>/dev/null ; then
|
||||
|
||||
@@ -9,9 +9,9 @@ about-plugin 'node version manager configuration'
|
||||
|
||||
export NVM_DIR=${NVM_DIR:-$HOME/.nvm}
|
||||
# This loads nvm
|
||||
if command -v brew &>/dev/null && [ -s $(brew --prefix nvm)/nvm.sh ]
|
||||
if _bash_it_homebrew_check && [ -s "${BASH_IT_HOMEBREW_PREFIX}/nvm.sh" ]
|
||||
then
|
||||
. $(brew --prefix nvm)/nvm.sh
|
||||
. "${BASH_IT_HOMEBREW_PREFIX}/nvm.sh"
|
||||
else
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user