Skip to content

Commit

Permalink
Merge pull request #2162 from brianphillips/patch-3
Browse files Browse the repository at this point in the history
  • Loading branch information
seefood authored Nov 6, 2024
2 parents a2a6155 + c5fdefe commit d743b62
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions plugins/available/nvm.plugin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ cite about-plugin
about-plugin 'node version manager configuration'

export NVM_DIR="${NVM_DIR:-$HOME/.nvm}"

# first check if NVM is managed by brew
NVM_BREW_PREFIX=""
if _bash_it_homebrew_check
then
NVM_BREW_PREFIX=$(brew --prefix nvm 2>/dev/null)
fi

# This loads nvm
if _bash_it_homebrew_check && [[ -s "${BASH_IT_HOMEBREW_PREFIX}/nvm.sh" ]]
if [[ -n "$NVM_BREW_PREFIX" && -s "${NVM_BREW_PREFIX}/nvm.sh" ]]
then
source "${BASH_IT_HOMEBREW_PREFIX}/nvm.sh"
source "${NVM_BREW_PREFIX}/nvm.sh"
else
[[ -s "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh"
fi
Expand Down

0 comments on commit d743b62

Please sign in to comment.