wbyoung/avn

Check $HOME/.node-version and /etc/.node-version

Closed this issue · 2 comments

I'd want to clarify todo item

Support switching back to the previous version of node that you were using when you leave a directory.

I guess avn should check $HOME and /etc locations for .node-version if there is none in current directory. It's the same way rvm works and covers the most of wanted scenarios.

The way that rvm 1.26.10 (latest) works is like so:

$ cd my-project # dir contains `.ruby-version` file with 2.0
$ cd .. # not a project directory, reverts to previously in use version, default version
$ rvm current
ruby-2.2.0

$ rvm use 1.9
$ cd my-project # dir contains `.ruby-version` file with 2.0
$ cd .. # not a project directory, reverts to previously in use version
$ rvm current
ruby-1.9.3-p551

This all assumes that you configured rvm to use 2.2 as the default.

As far as I can tell, rvm does not use ~/.ruby-version or /etc/.ruby-version. If I'm mistaken, can you point to the docs that suggest that it uses these?

I will re-open if the issue seems valid after a response is given to the previous comment.