jorgebucaran / nvm.fish

The Node.js version manager you'll adore, crafted just for Fish
https://git.io/nvm.fish
MIT License
2.06k stars 69 forks source link

.nvmrc not found - traversing the directory hierarchy #183

Closed franciscolourenco closed 2 years ago

franciscolourenco commented 2 years ago

nvm use/install works if .nvmrc is in the same directory, but not if it is in the parent directory

$ nvm use
nvm: Invalid version or missing ".nvmrc" file
$ fish --version
fish, version 3.4.1
$ nvm --version
nvm, version 2.2.7

Can you reproduce?

jorgebucaran commented 2 years ago

I can't reproduce this. Also using nvm.fish 2.2.7 and Fish 3.4.1. I added a test to show it works.

This is where we attempt to read the closest .nvmrc by traversing the directory hierarchy until it is found.

https://github.com/jorgebucaran/nvm.fish/blob/71593b324a5ad02996c6715a19358869440d9930/functions/nvm.fish#L3-L5