fast-nvm: fix nvm use with no .nvmrc

script was trying to run ``nvm use`` when there was no .nvmrc (eg: /usr/share)
This commit is contained in:
Guilherme Rugai Freire 2021-08-23 09:04:27 -03:00
parent 9f9057cd20
commit 09a2f62c5d
No known key found for this signature in database
GPG Key ID: 0F9FE41723A8A297

View File

@ -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