From 8784337d907f64a9610fbe7b88d650bb728119c8 Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Fri, 15 Aug 2014 03:06:13 -0500 Subject: [PATCH] Try alternative NVM location if installed via Homebrew on OS X. --- modules/node/init.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/node/init.zsh b/modules/node/init.zsh index a489a547..1d6b7fe2 100644 --- a/modules/node/init.zsh +++ b/modules/node/init.zsh @@ -9,6 +9,11 @@ # Load NVM into the shell session. if [[ -s "$HOME/.nvm/nvm.sh" ]]; then source "$HOME/.nvm/nvm.sh" +elif [[ "$OSTYPE" == darwin* ]]; then + # Try alternative NVM location if installed via Homebrew (See: `brew info nvm`) + if (( $+commands[brew] )) && [[ -d "$(brew --prefix nvm 2> /dev/null)" ]]; then + source $(brew --prefix nvm)/nvm.sh + fi fi # Return if requirements are not found.