mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-12 07:01:50 +00:00
Merge 8598fcf928
into b0244a133b
This commit is contained in:
commit
7fa457880d
10
install.sh
10
install.sh
@ -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."
|
||||||
|
Loading…
Reference in New Issue
Block a user