Created
March 14, 2017 10:27
-
-
Save chrisyip/6b87ae7594c1ca8bc0c7a7a893abf6ac to your computer and use it in GitHub Desktop.
Zsh: auto run `nvm use` if `.nvmrc` exists
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
function auto_nvm () { | |
if command -v nvm >/dev/null && [[ -a .nvmrc ]]; then | |
nvm use | |
fi | |
} | |
chpwd_functions=(${chpwd_functions[@]} "auto_nvm") | |
auto_nvm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks man