mirror of
https://github.com/lukechilds/zsh-nvm.git
synced 2025-01-30 09:47:14 +08:00
Install node version from .nvmrc if we don't have it
This commit is contained in:
parent
a01c899aec
commit
2f3f7dfc4e
@ -161,9 +161,10 @@ _zsh_nvm_auto_use() {
|
|||||||
if [[ -n "$nvmrc_path" ]]; then
|
if [[ -n "$nvmrc_path" ]]; then
|
||||||
local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")
|
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 use
|
[[ "$nvmrc_node_version" != "$node_version" ]] && nvm use && export NVM_AUTO_USE_ACTIVE=true
|
||||||
export NVM_AUTO_USE_ACTIVE=true
|
else
|
||||||
|
nvm install && export NVM_AUTO_USE_ACTIVE=true
|
||||||
fi
|
fi
|
||||||
elif [[ "$node_version" != "$(nvm version default)" ]] && [[ "$NVM_AUTO_USE_ACTIVE" = true ]]; then
|
elif [[ "$node_version" != "$(nvm version default)" ]] && [[ "$NVM_AUTO_USE_ACTIVE" = true ]]; then
|
||||||
echo "Reverting to nvm default version"
|
echo "Reverting to nvm default version"
|
||||||
|
Loading…
Reference in New Issue
Block a user