From ab967fcd17388736e2de5ce7dc22899c8bb53921 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Sat, 1 Feb 2020 21:00:46 -0500 Subject: [PATCH] Move nvm setup to .bash_profile instead of .bashrc --- bash/.bash_profile | 12 ++++++++++++ bash/.bashrc | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bash/.bash_profile b/bash/.bash_profile index 0c714a9..78300a0 100644 --- a/bash/.bash_profile +++ b/bash/.bash_profile @@ -2,6 +2,18 @@ # $HOME/.bash_profile # +if [ -f /usr/share/nvm/init-nvm.sh ]; +then + source /usr/share/nvm/init-nvm.sh +fi + +if [ -d "$HOME/.nvm" ]; +then +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion +fi + [[ -f "$HOME/.bashrc" ]] && source $HOME/.bashrc [[ -f "$HOME/.bash_local" ]] && source "$HOME/.bash_local" diff --git a/bash/.bashrc b/bash/.bashrc index 7add4b1..4fc0edb 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -8,11 +8,6 @@ alias ls='ls -G' PS1='[\u@\h \W]\$ ' -if [ -f /usr/share/nvm/init-nvm.sh ]; -then - source /usr/share/nvm/init-nvm.sh -fi - if [ -x "$(command -v direnv)" ]; then eval "$(direnv hook bash)" @@ -20,13 +15,6 @@ fi alias edit="$(which emacsclient) " -if [ -d "$HOME/.nvm" ]; -then -export NVM_DIR="$HOME/.nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion -fi - if [ -f ~/.bashrc.local ]; then source ~/.bashrc.local