Skip to content

Instantly share code, notes, and snippets.

@mCzolko
Last active October 8, 2019 11:33
Show Gist options
  • Save mCzolko/5c073f8dea04a1f70e14272dcc4ed0f3 to your computer and use it in GitHub Desktop.
Save mCzolko/5c073f8dea04a1f70e14272dcc4ed0f3 to your computer and use it in GitHub Desktop.
NVM automatic switch
# Install NVM or FVM
# https://github.com/nvm-sh/nvm
# https://github.com/Schniz/fnm
cd () { builtin cd "$@" && chpwd; }
chpwd () {
NVM_PATH="$PWD/.nvmrc"
if test -f "$NVM_PATH"; then
nvm use
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment