Browse Source

[Docs] [Fix] zsh autochange: only `nvm install` if we can’t `nvm use`

butlerx 8 years ago committed by Jordan Harband
parent
commit
f1a5f2a15f
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
  1. 4
      README.markdown

4
README.markdown

@ -322,8 +322,10 @@ load-nvmrc() { @@ -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…
Cancel
Save