Skip to content

Instantly share code, notes, and snippets.

@Fallenstedt
Created December 14, 2022 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fallenstedt/b0ae111acb911211ae37e0ce91d425e7 to your computer and use it in GitHub Desktop.
Save Fallenstedt/b0ae111acb911211ae37e0ce91d425e7 to your computer and use it in GitHub Desktop.
Run "nvm use" when changing into any directory
#!/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