Skip to content

Commit 6148c89

Browse files
authored
Balance the if statement in bash example
Nesting the `elif` at the same level as the `if` and `fi` makes it clear which code applies to which branch (no .nvmrc file / found .nvmrc file). I wasted a while looking at it trying to work out how it did anything if there was a .nvmrc file, because obviously the `if` didn't match and I couldn't see the `elif` branch.
1 parent e9b2693 commit 6148c89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ cdnvm() {
572572
nvm use default;
573573
fi
574574

575-
elif [[ -s $nvm_path/.nvmrc && -r $nvm_path/.nvmrc ]]; then
575+
elif [[ -s $nvm_path/.nvmrc && -r $nvm_path/.nvmrc ]]; then
576576
declare nvm_version
577577
nvm_version=$(<"$nvm_path"/.nvmrc)
578578

0 commit comments

Comments
 (0)