Skip to content

Commit

Permalink
Only nvm install if we can't nvm use
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechilds committed Jan 5, 2017
1 parent 40e4097 commit 5f5bdd7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 5f5bdd7

Please sign in to comment.