Skip to content

Instantly share code, notes, and snippets.

@morewry
Forked from jusopi/check.sh
Created February 14, 2017 22:18
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 morewry/1824707f23e0532651d7a2daea1d3333 to your computer and use it in GitHub Desktop.
Save morewry/1824707f23e0532651d7a2daea1d3333 to your computer and use it in GitHub Desktop.
Set node version per project using .nvmrc file
#!/bin/sh
enter_directory(){
if [ "$PWD" != "$PREV_PWD" ]; then
PREV_PWD="$PWD";
if [ -e ".nvmrc" ]; then
nvm use;
fi
fi
}
export PROMPT_COMMAND="$PROMPT_COMMAND enter_directory;"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment