From 8eb90f7ac1ccdcdd77b28df3d09a3dca063b0135 Mon Sep 17 00:00:00 2001 From: Brian Phillips <28457+brianphillips@users.noreply.github.com> Date: Tue, 30 Aug 2022 16:48:54 -0500 Subject: [PATCH] Fix loading of nvm for brew-installed nvm This reverts to the original (working) version from 2017. During the most recent refactor to use the `_bash_it_homebrew_check` helper method, it was overlooked that `${BASH_IT_HOMEBREW_PREFIX}/nvm.sh` is not the equivalent to `$(brew --prefix nvm)/nvm.sh` since `BASH_IT_HOMEBREW_PREFIX` is set from `brew --prefix` instead of `brew --prefix nvm`. --- plugins/available/nvm.plugin.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/available/nvm.plugin.bash b/plugins/available/nvm.plugin.bash index 0e6da5d8..3966cdf2 100644 --- a/plugins/available/nvm.plugin.bash +++ b/plugins/available/nvm.plugin.bash @@ -10,9 +10,9 @@ about-plugin 'node version manager configuration' export NVM_DIR="${NVM_DIR:-$HOME/.nvm}" # This loads nvm -if _bash_it_homebrew_check && [[ -s "${BASH_IT_HOMEBREW_PREFIX}/nvm.sh" ]] +if _bash_it_homebrew_check && [[ -s "$(brew --prefix nvm)/nvm.sh" ]] then - source "${BASH_IT_HOMEBREW_PREFIX}/nvm.sh" + source "$(brew --prefix nvm)/nvm.sh" else [[ -s "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh" fi