This commit is contained in:
Dag Wieers 2016-06-25 16:13:17 +00:00 committed by GitHub
commit 7fa457880d

View File

@ -126,11 +126,7 @@ nvm_detect_profile() {
SHELLTYPE="$(basename "/$SHELL")" SHELLTYPE="$(basename "/$SHELL")"
if [ "$SHELLTYPE" = "bash" ]; then if [ "$SHELLTYPE" = "bash" ]; then
if [ -f "$HOME/.bashrc" ]; then DETECTED_PROFILE="$HOME/.bash_profile"
DETECTED_PROFILE="$HOME/.bashrc"
elif [ -f "$HOME/.bash_profile" ]; then
DETECTED_PROFILE="$HOME/.bash_profile"
fi
elif [ "$SHELLTYPE" = "zsh" ]; then elif [ "$SHELLTYPE" = "zsh" ]; then
DETECTED_PROFILE="$HOME/.zshrc" DETECTED_PROFILE="$HOME/.zshrc"
fi fi
@ -138,8 +134,6 @@ nvm_detect_profile() {
if [ -z "$DETECTED_PROFILE" ]; then if [ -z "$DETECTED_PROFILE" ]; then
if [ -f "$HOME/.profile" ]; then if [ -f "$HOME/.profile" ]; then
DETECTED_PROFILE="$HOME/.profile" DETECTED_PROFILE="$HOME/.profile"
elif [ -f "$HOME/.bashrc" ]; then
DETECTED_PROFILE="$HOME/.bashrc"
elif [ -f "$HOME/.bash_profile" ]; then elif [ -f "$HOME/.bash_profile" ]; then
DETECTED_PROFILE="$HOME/.bash_profile" DETECTED_PROFILE="$HOME/.bash_profile"
elif [ -f "$HOME/.zshrc" ]; then elif [ -f "$HOME/.zshrc" ]; then
@ -229,7 +223,7 @@ nvm_do_install() {
local NVM_PROFILE local NVM_PROFILE
NVM_PROFILE=$(nvm_detect_profile) NVM_PROFILE=$(nvm_detect_profile)
SOURCE_STR="\nexport NVM_DIR=\"$NVM_DIR\"\n[ -s \"\$NVM_DIR/nvm.sh\" ] && . \"\$NVM_DIR/nvm.sh\" # This loads nvm" SOURCE_STR="\nexport NVM_DIR=\"$NVM_DIR\"\n[ \"\$PS1\" -s \"\$NVM_DIR/nvm.sh\" ] && . \"\$NVM_DIR/nvm.sh\" # This loads nvm"
if [ -z "$NVM_PROFILE" ] ; then if [ -z "$NVM_PROFILE" ] ; then
echo "=> Profile not found. Tried $NVM_PROFILE (as defined in \$PROFILE), ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile." echo "=> Profile not found. Tried $NVM_PROFILE (as defined in \$PROFILE), ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile."