Skip to content

Commit

Permalink
Improve zsh script to revert to default node version when exiting a .…
Browse files Browse the repository at this point in the history
…nvmrc directory.
  • Loading branch information
ejinotti committed May 6, 2016
1 parent eb329ae commit 05a2d98
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ autoload -U add-zsh-hook
load-nvmrc() {
if [[ -f .nvmrc && -r .nvmrc ]]; then
nvm use
elif [[ $(nvm version) != $(nvm version default) ]]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc
Expand Down

0 comments on commit 05a2d98

Please sign in to comment.