mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-09-25 19:17:59 +00:00
[Fix] install
: Detect correct profile based on $SHELL var
This commit is contained in:

committed by
Jordan Harband

parent
812d6e4ab4
commit
e98e9d9e4b
@@ -267,14 +267,16 @@ nvm_detect_profile() {
|
||||
local DETECTED_PROFILE
|
||||
DETECTED_PROFILE=''
|
||||
|
||||
if [ -n "${BASH_VERSION-}" ]; then
|
||||
if [ "${SHELL#*bash}" != "$SHELL" ]; then
|
||||
if [ -f "$HOME/.bashrc" ]; then
|
||||
DETECTED_PROFILE="$HOME/.bashrc"
|
||||
elif [ -f "$HOME/.bash_profile" ]; then
|
||||
DETECTED_PROFILE="$HOME/.bash_profile"
|
||||
fi
|
||||
elif [ -n "${ZSH_VERSION-}" ]; then
|
||||
DETECTED_PROFILE="$HOME/.zshrc"
|
||||
elif [ "${SHELL#*zsh}" != "$SHELL" ]; then
|
||||
if [ -f "$HOME/.zshrc" ]; then
|
||||
DETECTED_PROFILE="$HOME/.zshrc"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$DETECTED_PROFILE" ]; then
|
||||
|
Reference in New Issue
Block a user