mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-08-17 19:13:43 +00:00
Compare commits
3 Commits
81439a3bf9
...
932debb520
Author | SHA1 | Date | |
---|---|---|---|
![]() |
932debb520 | ||
![]() |
4beab63631 | ||
![]() |
c106455087 |
@ -40,7 +40,7 @@ nvm_profile_is_bash_or_zsh() {
|
||||
local TEST_PROFILE
|
||||
TEST_PROFILE="${1-}"
|
||||
case "${TEST_PROFILE-}" in
|
||||
*"/.bashrc" | *"/.bash_profile" | *"/.zshrc" | *"/.zprofile")
|
||||
*"/.bashrc" | *"/.bash_profile" | *"/.zshenv" | *"/.zshrc" | *"/.zprofile")
|
||||
return
|
||||
;;
|
||||
*)
|
||||
@ -300,11 +300,13 @@ nvm_detect_profile() {
|
||||
DETECTED_PROFILE="$HOME/.zshrc"
|
||||
elif [ -f "$HOME/.zprofile" ]; then
|
||||
DETECTED_PROFILE="$HOME/.zprofile"
|
||||
elif [ -f "$HOME/.zshenv" ]; then
|
||||
DETECTED_PROFILE="$HOME/.zshenv"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$DETECTED_PROFILE" ]; then
|
||||
for EACH_PROFILE in ".profile" ".bashrc" ".bash_profile" ".zprofile" ".zshrc"
|
||||
for EACH_PROFILE in ".profile" ".bashrc" ".bash_profile" ".zprofile" ".zshrc" ".zshenv"
|
||||
do
|
||||
if DETECTED_PROFILE="$(nvm_try_profile "${HOME}/${EACH_PROFILE}")"; then
|
||||
break
|
||||
|
12
nvm.sh
12
nvm.sh
@ -503,9 +503,9 @@ $(nvm_wrap_with_color_code 'y' "${warn_text}")"
|
||||
}
|
||||
|
||||
nvm_process_nvmrc() {
|
||||
local NVMRC_PATH="$1"
|
||||
local NVMRC_PATH
|
||||
NVMRC_PATH="$1"
|
||||
local lines
|
||||
local unpaired_line
|
||||
|
||||
lines=$(command sed 's/#.*//' "$NVMRC_PATH" | command sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | nvm_grep -v '^$')
|
||||
|
||||
@ -515,8 +515,12 @@ nvm_process_nvmrc() {
|
||||
fi
|
||||
|
||||
# Initialize key-value storage
|
||||
local keys=''
|
||||
local values=''
|
||||
local keys
|
||||
keys=''
|
||||
local values
|
||||
values=''
|
||||
local unpaired_line
|
||||
unpaired_line=''
|
||||
|
||||
while IFS= read -r line; do
|
||||
if [ -z "${line}" ]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user