Created
December 14, 2022 23:20
-
-
Save Fallenstedt/b0ae111acb911211ae37e0ce91d425e7 to your computer and use it in GitHub Desktop.
Run "nvm use" when changing into any directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run `nvm use` when changing into directory if the .nvmrc exists | |
function cd() { | |
builtin cd "$@" | |
if [[ -e .nvmrc ]] | |
then | |
nvm use | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment