mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-09-09 14:49:04 +00:00
[New] install.sh
: allow user to explicitly opt out of nvm adding the source string
this is done by checking if the user supplies `PROFILE=/dev/null` when running `install.sh`, the `nvm_detect_profile` function will not output any strings, causing `nvm_do_install` to skip adding `SOURCE_STR`.
This commit is contained in:

committed by
Jordan Harband

parent
c50ea6f0a3
commit
9854928ba9
@@ -28,6 +28,12 @@ setup
|
||||
# Confirm profile detection via $SHELL works and that $PROFILE overrides profile detection
|
||||
#
|
||||
|
||||
# setting $PROFILE to /dev/null should return no detected profile
|
||||
NVM_DETECT_PROFILE="$(PROFILE='/dev/null'; nvm_detect_profile)"
|
||||
if [ -n "$NVM_DETECT_PROFILE" ]; then
|
||||
die "nvm_detect_profile still detected a profile even though PROFILE=/dev/null"
|
||||
fi
|
||||
|
||||
# .bashrc should be detected for bash
|
||||
NVM_DETECT_PROFILE="$(BASH_VERSION="1"; unset PROFILE; nvm_detect_profile)"
|
||||
if [ "$NVM_DETECT_PROFILE" != "$HOME/.bashrc" ]; then
|
||||
|
Reference in New Issue
Block a user