[New] Allow nvm_find_nvmrc to use custom path and name

This commit is contained in:
Victor Mihalache 2023-11-21 19:37:23 +01:00
parent 4bdd57ba0f
commit db466ab0cb
No known key found for this signature in database
GPG Key ID: 771E83E6A9320D63

7
nvm.sh
View File

@ -461,9 +461,10 @@ nvm_find_up() {
nvm_find_nvmrc() {
local dir
dir="$(nvm_find_up '.nvmrc')"
if [ -e "${dir}/.nvmrc" ]; then
nvm_echo "${dir}/.nvmrc"
local rcfile="${1:-.nvmrc}"
dir="$(nvm_find_up "${rcfile}")"
if [ -e "${dir}/${rcfile}" ]; then
nvm_echo "${dir}/${rcfile}"
fi
}