Skip to content

Instantly share code, notes, and snippets.

View Pierre-Thibault's full-sized avatar

Pierre Thibault Pierre-Thibault

View GitHub Profile
@sndrs
sndrs / auto_nvm_use.sh
Last active March 18, 2024 11:29 — forked from jusopi/check.sh
Automatically set node version per project using .nvmrc file
# This will run `nvm use` everytime you change directory, if
# 1. an .nvmrc file is present
# 2. there is no .nvmrc but you're not using your default node
# Add it to your `.bash_profile` (or wherever else is suitable for your setup).
enter_directory(){
if [ "$PWD" != "$PREV_PWD" ]; then
PREV_PWD="$PWD";
if [ -e ".nvmrc" ]; then
nvm use;