Skip to content

Instantly share code, notes, and snippets.

@jusopi
Last active November 14, 2017 09:57
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save jusopi/fa6d03321991620778a2 to your computer and use it in GitHub Desktop.
Save jusopi/fa6d03321991620778a2 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;"
@jusopi
Copy link
Author

jusopi commented Aug 12, 2016

Fixed the misspelled $PROMP_COMMAND typo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment