Skip to content

Instantly share code, notes, and snippets.

@dehamzah
Created February 7, 2017 03:58
Show Gist options
  • Save dehamzah/59444e79c85e2e578845ac7be7c6e388 to your computer and use it in GitHub Desktop.
Save dehamzah/59444e79c85e2e578845ac7be7c6e388 to your computer and use it in GitHub Desktop.
Add this to your .bashrc / .zshrc to automatically set node version that set in .nvmrc when changing directory
# Automatically switch to node version that set in .nvmrc
# if we change directory to that folder
cd() {
builtin cd "$@"
if [ -e ./.nvmrc ];then
{
nvm use
} &> /dev/null
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment