-
Notifications
You must be signed in to change notification settings - Fork 54
Direct support for .nvmrc? #17
Comments
It seems like these line would need to change: https://github.com/wbyoung/avn/blob/master/lib/hooks.js#L72 |
Since |
I think I agree, this makes sense to support. I'm hesitating slightly on this for a few reasons:
I'm curious about your thoughts on _#_1, @ljharb. Can you see potential confusion among users if |
Implementation in 3d74623 shows that _#_2 from above is actually not a concern. One side effect of the current implementation is that an |
I don't understand why I think that any For what it's worth, I also don't think that |
@ljharb it wouldn't cause a problem for which version should be activated, but it would cause a slight performance problem as we'd be checking more directories for the presence of a file. A quick test reveals that 30 additional file checks added to the The bigger performance issue is the way that things are architected right now, a node script is run when the |
Dotfile Thoughts: I think the These cases fall into two different categories:
Per-project configuration can only look upward by default if it knows where the project root is (passing the project level has it cross into per-user). That's why JSHint and JSCS are better served with an Per-user configuration can look anywhere on the machine & it's still a configuration for the user. A With So the main question, is automatic version switching something that is per-project or per-user. If it's per-project, then Perhaps, though, it's the responsibility of the user to make this decision. They install the files where they want & we don't worry — just always assume that traversing outside of a project is acceptable.
What I don't like from above is that the |
This includes the following changes: - Plugins can provide a load.sh file - Custom version files are supported via plugins adding to `__avn_files` - Parent directories are searched for version files. - Configuration will not be updated when active version file has not changed. - Output includes chosen version file when it is not `./.node-version`.
@danawoodman I've got something pushed on some branches (10e0ae9 and 48445caa) if you'd like to give it a try. Do the following, then restart your shell:
I'd love to know whether it works well for you or not. |
This is now available in npm i -g avn avn-nvm
avn setup |
Awesome, thanks @wbyoung that's working great! Only thing I got caught up on was it seems avn creates a |
@danawoodman I'd be happy to accept a pull request that accounts properly for all configurations of all shell types and config files as we'd expect them to be appropriately used across different platforms. Right now |
Is it possible for avn to directly support the
.nvmrc
file I already have in my project?Perhaps some logic could be incorporated to do an
OR
operation when searching (e.g.'.node-version' || '.nvmrc'
). Having to duplicate that file is unfortunate because then both have to be in sync.I'm currently symlinking the file but would love to not have to do that.
Thanks!
The text was updated successfully, but these errors were encountered: