1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-12-22 06:58:01 +00:00

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.
This commit is contained in:
Indrajit Raychaudhuri 2021-05-02 21:21:50 -05:00 committed by Indrajit Raychaudhuri
parent e87a9b0a93
commit 68300e6de4

View File

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