Browse Source

node: Fixup nvm path detection for Homebrew based nvm

Prefer using `brew --prefix nvm` instead of just `brew --prefix` and
actually use the variable `nvm_prefix` once detected and set up.
master
Indrajit Raychaudhuri 4 years ago committed by Indrajit Raychaudhuri
parent
commit
d6432a9551
  1. 4
      modules/node/init.zsh

4
modules/node/init.zsh

@ -12,8 +12,8 @@ if [[ -s "${NVM_DIR:=$HOME/.nvm}/nvm.sh" ]]; then
# Load package manager installed NVM into the shell session. # Load package manager installed NVM into the shell session.
elif (( $+commands[brew] )) && \ elif (( $+commands[brew] )) && \
[[ -d "${nvm_prefix::="$(brew --prefix 2> /dev/null)"/opt/nvm}" ]]; then [[ -d "${nvm_prefix::="$(brew --prefix nvm 2> /dev/null)"}" ]]; then
source "$(brew --prefix nvm)/nvm.sh" source "${nvm_prefix}/nvm.sh"
unset nvm_prefix unset nvm_prefix
# Load manually installed nodenv into the shell session. # Load manually installed nodenv into the shell session.

Loading…
Cancel
Save