From 68300e6de4eb1c74b4b77c8cfea7acef0518bf99 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Sun, 2 May 2021 21:21:50 -0500 Subject: [PATCH] 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. --- modules/node/init.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/node/init.zsh b/modules/node/init.zsh index 6fb68f30..45a4e8f3 100644 --- a/modules/node/init.zsh +++ b/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. 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.