prezto icon indicating copy to clipboard operation
prezto copied to clipboard

Add cwd hook to change node version via nvm

Open sgtsquiggs opened this issue 7 years ago • 1 comments

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.

sgtsquiggs avatar Jun 21 '17 20:06 sgtsquiggs

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.

belak avatar Jun 21 '17 20:06 belak