diff --git a/etc/profile.d/99-brew.sh b/etc/profile.d/99-brew.sh index a5d02e65..963f7299 100644 --- a/etc/profile.d/99-brew.sh +++ b/etc/profile.d/99-brew.sh @@ -3,8 +3,13 @@ if [ -d /home/linuxbrew/.linuxbrew/bin ]; then eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv) fi -if [ -d /home/linuxbrew/.linuxbrew/opt/nvm ]; then +# https://github.com/nvm-sh/nvm +if [ -d ~/.nvm ]; then + . ~/.nvm/nvm.sh + . ~/.nvm/bash_completion +elif [ -d /home/linuxbrew/.linuxbrew/opt/nvm ]; then + mkdir -p /home/linuxbrew/.nvm export NVM_DIR=/home/linuxbrew/.nvm - [ -s "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" ] && \. "/home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh" # This loads nvm - [ -s "/home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion + . /home/linuxbrew/.linuxbrew/opt/nvm/nvm.sh + . /home/linuxbrew/.linuxbrew/opt/nvm/etc/bash_completion.d/nvm fi