From db466ab0cb08952a9d41bc77eb80baa8d1c6f706 Mon Sep 17 00:00:00 2001 From: Victor Mihalache Date: Tue, 21 Nov 2023 19:37:23 +0100 Subject: [PATCH] [New] Allow `nvm_find_nvmrc` to use custom path and name --- nvm.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nvm.sh b/nvm.sh index b2af93c..9905017 100644 --- a/nvm.sh +++ b/nvm.sh @@ -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 }