[readme] cdnvm(): handle failed dir change

If cd command fails, return whatever cd returned, instead of marching ahead
Jer Wilson 2022-06-27 17:21:45 -07:00 committed by Jordan Harband
parent 95269ff055
commit 5a4e9184f1
No known key found for this signature in database
GPG Key ID: 9F6A681E35EF8B56
1 changed files with 1 additions and 1 deletions

View File

@ -555,7 +555,7 @@ Put the following at the end of your `$HOME/.bashrc`:
```bash ```bash
cdnvm() { cdnvm() {
command cd "$@"; command cd "$@" || return $?
nvm_path=$(nvm_find_up .nvmrc | tr -d '\n') nvm_path=$(nvm_find_up .nvmrc | tr -d '\n')
# If there are no .nvmrc file, use the default nvm version # If there are no .nvmrc file, use the default nvm version