File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -306,7 +306,7 @@ nvm_detect_profile() {
306306 if [ -z " $DETECTED_PROFILE " ]; then
307307 for EACH_PROFILE in " .profile" " .bashrc" " .bash_profile" " .zprofile" " .zshrc"
308308 do
309- if DETECTED_PROFILE=" $( nvm_try_profile " ${HOME} /${EACH_PROFILE} " ) " ; then
309+ if DETECTED_PROFILE=" $( nvm_try_profile " ${ZDOTDIR :- ${ HOME} } /${EACH_PROFILE} " ) " ; then
310310 break
311311 fi
312312 done
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ cleanup () {
2323 unset -f setup cleanup die
2424 unset ZDOTDIR
2525 rm -f " .bashrc" " .bash_profile" " .zprofile" " .zshrc" " .profile" " test_profile" > " /dev/null" 2>&1
26- rm -rf zdot >&1
26+ rm -rf zdotdir 2 >&1
2727}
2828
2929die () { echo " $@ " ' $NVM_DETECT_PROFILE:' " $NVM_DETECT_PROFILE " ; cleanup; exit 1; }
9494#
9595
9696# It should favor .profile if file exists
97- NVM_DETECT_PROFILE=" $( unset SHELL; nvm_detect_profile) "
97+ NVM_DETECT_PROFILE=" $( unset SHELL; unset ZDOTDIR ; nvm_detect_profile) "
9898if [ " $NVM_DETECT_PROFILE " != " $HOME /.profile" ]; then
9999 die " nvm_detect_profile should have selected .profile"
100100fi
101101
102102# Otherwise, it should favor .bashrc if file exists
103103rm " .profile"
104- NVM_DETECT_PROFILE=" $( unset SHELL; nvm_detect_profile) "
104+ NVM_DETECT_PROFILE=" $( unset SHELL; unset ZDOTDIR ; nvm_detect_profile) "
105105if [ " $NVM_DETECT_PROFILE " != " $HOME /.bashrc" ]; then
106106 die " nvm_detect_profile should have selected .bashrc"
107107fi
108108
109109# Otherwise, it should favor .bash_profile if file exists
110110rm " .bashrc"
111- NVM_DETECT_PROFILE=" $( unset SHELL; nvm_detect_profile) "
111+ NVM_DETECT_PROFILE=" $( unset SHELL; unset ZDOTDIR ; nvm_detect_profile) "
112112if [ " $NVM_DETECT_PROFILE " != " $HOME /.bash_profile" ]; then
113113 die " nvm_detect_profile should have selected .bash_profile"
114114fi
You can’t perform that action at this time.
0 commit comments