Find `.nvmrc` files upwards.
parent
66455f7c77
commit
038c1f3d0f
10
nvm.sh
10
nvm.sh
|
@ -35,9 +35,13 @@ if [ -z "$NVM_NODEJS_ORG_MIRROR" ]; then
|
|||
fi
|
||||
|
||||
nvm_find_nvmrc() {
|
||||
if [ -e '.nvmrc' ]; then
|
||||
echo '.nvmrc'
|
||||
fi
|
||||
typeset dir="$PWD"
|
||||
typeset found=""
|
||||
while [ "$dir" != "/" ] && [ "$found" = "" ]; do
|
||||
found=$(find "$dir" -maxdepth 1 -name ".nvmrc")
|
||||
dir=$(cd "$dir/.." && pwd -P)
|
||||
done
|
||||
echo $found
|
||||
}
|
||||
|
||||
# Obtain nvm version from rc file
|
||||
|
|
Loading…
Reference in New Issue