Skip to content
Myr

[Fix] `read` exits 1 when `.nvmrc` lacks a trailing newline - avoid that.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Per https://github.com/creationix/nvm/issues/993#issuecomment-205399603

authored by Jordan Harband · committed by Jordan Harband · parent 6299cba · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:nvm.sh+1 added-1 removed
138 unmodified lines
139 export NVM_RC_VERSION=''140 local NVMRC_PATH141 NVMRC_PATH="$(nvm_find_nvmrc)"142 if [ -e "$NVMRC_PATH" ]; then143 read -r NVM_RC_VERSION < "$NVMRC_PATH"143 read -r NVM_RC_VERSION < "$NVMRC_PATH" || printf ''144 echo "Found '$NVMRC_PATH' with version <$NVM_RC_VERSION>"145 else146 >&2 echo "No .nvmrc file found"147 return 1
2295 unmodified lines