isaacs / nave

Virtual Environments for Node

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fallback to .nvmrc if .naverc isn't specified for nave auto

goodevilgenius opened this issue · comments

Most of my coworkers use nvm (although I've tried to encourage them to use nave instead), so our projects already have .nvmrc files, but not .naverc files.

I could symlink .naverc to .nvmrc in each project, but I'd rather not add something like that to our repos when I'm the only one that uses it.

So, as an alternative, I think it would be really useful if, when doing nave auto <dir>, if there's no .naverc file, but there is an .nvmrc file, to use that instead.

Good idea. Patch welcome.

Is the file format the same? Could we just fall back on the filename?

Yes. The format is the same. I usually symlink one to the other when appropriate.

Do note that .nvmrc supports lots of things - a version like 1.2.3, a major.minor like 1.2 or 1.2., a major like 1 or 1. (all with or without a leading v), but also all built-in and user-supplied aliases, like node, iojs, default, as well as LTS aliases, like lts/*, lts/erbium, lts/-3, etc.

Nave supports most of those, but of course, I can't promise that we support them the same way. Anyway, I'd be fine with calling it best-effort support, and add support for other forms as people run into issues.