Skip to content

Commit 5dc6658

Browse files
committed
plugin/nvm: fix homebrew path
1 parent 2e143cf commit 5dc6658

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugins/available/nvm.plugin.bash

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ about-plugin 'node version manager configuration'
1010
export NVM_DIR
1111

1212
# shellcheck disable=SC1091 # This loads nvm
13-
if _bash_it_homebrew_check && [[ -s "${BASH_IT_HOMEBREW_PREFIX?}/nvm.sh" ]]; then
14-
source "${BASH_IT_HOMEBREW_PREFIX?}/nvm.sh"
13+
if _bash_it_homebrew_check && [[ -s "${BASH_IT_HOMEBREW_PREFIX?}/opt/nvm/nvm.sh" ]]; then
14+
mkdir -p "${NVM_DIR}"
15+
source "${BASH_IT_HOMEBREW_PREFIX?}/opt/nvm/nvm.sh"
1516
elif [[ -s "${NVM_DIR}/nvm.sh" ]]; then
1617
source "${NVM_DIR}/nvm.sh"
1718
fi
1819

1920
if ! _command_exists nvm; then
2021
_log_warning "Bash-it no longer bundles the nvm script. Please install the latest version from
21-
https://github.com/creationix/nvm.git"
22+
https://github.com/creationix/nvm.git or Homebrew"
2223
_log_warning "if you want to use nvm. You can keep this plugin enabled once you have installed nvm."
2324
return 1
2425
fi

0 commit comments

Comments
 (0)