From 5a4e9184f131ebdaf8d73bc2e22b444bc00daf9f Mon Sep 17 00:00:00 2001 From: Jer Wilson Date: Mon, 27 Jun 2022 17:21:45 -0700 Subject: [PATCH] [readme] cdnvm(): handle failed dir change If cd command fails, return whatever cd returned, instead of marching ahead --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 303e924..e3f2f3a 100644 --- a/README.md +++ b/README.md @@ -555,7 +555,7 @@ Put the following at the end of your `$HOME/.bashrc`: ```bash cdnvm() { - command cd "$@"; + command cd "$@" || return $? nvm_path=$(nvm_find_up .nvmrc | tr -d '\n') # If there are no .nvmrc file, use the default nvm version