mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-09-18 22:23:51 +00:00
PROFILE env var should override detected profile
Add tests for PROFILE overriding detected files
This commit is contained in:

committed by
Matthew Campbell

parent
cb138a1815
commit
918fcb4bd2
@@ -31,6 +31,15 @@ _PROFILE=$(nvm_detect_profile)
|
||||
echo "_\$_PROFILE: _$_PROFILE" &&
|
||||
die "nvm_detect_profile didn't pick $SHELL and $HOME/.bashrc" )
|
||||
|
||||
# But $PROFILE should override
|
||||
PROFILE=test_profile
|
||||
_PROFILE=$(nvm_detect_profile)
|
||||
[ "_$_PROFILE" = "_$PROFILE" ] || ( echo "_\$_PROFILE: _$_PROFILE" &&
|
||||
echo "_\$PROFILE: _$PROFILE" &&
|
||||
die "nvm_detect_profile didn't pick \$PROFILE" )
|
||||
unset PROFILE
|
||||
|
||||
|
||||
#Let's force $SHELL to be zsh
|
||||
SHELL="/usr/bin/zsh"
|
||||
|
||||
@@ -40,6 +49,14 @@ _PROFILE=$(nvm_detect_profile)
|
||||
echo "_\$_PROFILE: _$_PROFILE" &&
|
||||
die "nvm_detect_profile didn't pick $SHELL and $HOME/.zshrc" )
|
||||
|
||||
# But $PROFILE should override
|
||||
PROFILE=test_profile
|
||||
_PROFILE=$(nvm_detect_profile)
|
||||
[ "_$_PROFILE" = "_$PROFILE" ] || ( echo "_\$_PROFILE: _$_PROFILE" &&
|
||||
echo "_\$PROFILE: _$PROFILE" &&
|
||||
die "nvm_detect_profile didn't pick \$PROFILE" )
|
||||
unset PROFILE
|
||||
|
||||
# if we unset shell it looks for the files
|
||||
unset SHELL
|
||||
|
||||
|
Reference in New Issue
Block a user