Last active
November 14, 2017 09:57
-
-
Save jusopi/fa6d03321991620778a2 to your computer and use it in GitHub Desktop.
Set node version per project using .nvmrc file
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/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;" |
Fixed the misspelled $PROMP_COMMAND typo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this! One thing I added to my bash was after I started using this I would lose track which tabs in iTerm were what node version (I work on a bunch of projects that use different node version sadly...) It helped to just change the tab name to say the node version as well. Hope someone finds it useful.