improve nvm bash profile scripts

Closes #35013.

Signed-off-by: Sean Molenaar <smillerdev@me.com>
This commit is contained in:
Steve Mao 2018-12-12 11:15:11 +11:00 committed by Sean Molenaar
parent ed16afddf3
commit edd2e81f9c

View file

@ -25,7 +25,8 @@ class Nvm < Formula
configuration file:
export NVM_DIR="$HOME/.nvm"
. "#{opt_prefix}/nvm.sh"
[ -s "#{opt_prefix}/nvm.sh" ] && \. "#{opt_prefix}/nvm.sh" # This loads nvm
[ -s "#{opt_prefix}/etc/bash_completion" ] && \. "#{opt_prefix}/etc/bash_completion" # This loads nvm bash_completion
You can set $NVM_DIR to any location, but leaving it unchanged from
#{prefix} will destroy any nvm-installed Node installations