From 09a2f62c5d5aebba5f130a30a8126ea84259e8f0 Mon Sep 17 00:00:00 2001 From: Guilherme Rugai Freire <41879254+GRFreire@users.noreply.github.com> Date: Mon, 23 Aug 2021 09:04:27 -0300 Subject: [PATCH] fast-nvm: fix nvm use with no .nvmrc script was trying to run ``nvm use`` when there was no .nvmrc (eg: /usr/share) --- .fast-nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.fast-nvm.sh b/.fast-nvm.sh index a9e26fd..4ee8802 100644 --- a/.fast-nvm.sh +++ b/.fast-nvm.sh @@ -11,7 +11,7 @@ DEFAULT=$(locate_nvmrc) cd() { if builtin cd "$@" 2>/dev/null; then FOUND="$(locate_nvmrc)" - if [ "$DEFAULT" != "$FOUND" ]; then + if [ "$FOUND" != "" ] && [ "$DEFAULT" != "$FOUND" ]; then DEFAULT=$FOUND nvm use fi