Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cwd hook to change node version via nvm #1339

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sgtsquiggs
Copy link
Contributor

This is based on the python virtualenv auto-workon cwd hook.

It isn't perfect: if you change your .nvmrc file it will not pick up the change until you cwd outside of the project, which in turn returns you to the 'default' alias in nvm. This imperfection is because nvm's resolving of .nvmrc is too slow to fire on every cwd. Instead, I'm caching the absolute path of the relevant .nvmrc.

@belak
Copy link
Collaborator

belak commented Jun 21, 2017

Hm, it seems like the project-root stuff could be refactored into a function if that's going to be shared between a number of other tools... and I could see it as being useful elsewhere.

I'm also a terrible person to test this because I don't use node very often.

bameda added a commit to bameda/prezto that referenced this pull request Jul 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants