mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-10 14:21:50 +00:00
[Docs] [Fix] zsh autochange: only nvm install
if we can’t nvm use
This commit is contained in:
parent
40e40975eb
commit
f1a5f2a15f
@ -322,8 +322,10 @@ load-nvmrc() {
|
||||
if [ -n "$nvmrc_path" ]; then
|
||||
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
|
||||
|
||||
if [ "$nvmrc_node_version" != "N/A" ] && [ "$nvmrc_node_version" != "$node_version" ]; then
|
||||
if [ "$nvmrc_node_version" = "N/A" ]; then
|
||||
nvm install
|
||||
elif [ "$nvmrc_node_version" != "$node_version" ]; then
|
||||
nvm use
|
||||
fi
|
||||
elif [ "$node_version" != "$(nvm version default)" ]; then
|
||||
echo "Reverting to nvm default version"
|
||||
|
Loading…
Reference in New Issue
Block a user