From d3e334d86d1ee680c6af9ea32b1020ebaadbf48b Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 4 Apr 2016 22:08:36 -0700 Subject: [PATCH] [Fix] `read` exits 1 when `.nvmrc` lacks a trailing newline - avoid that. Per https://github.com/creationix/nvm/issues/993#issuecomment-205399603 --- nvm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvm.sh b/nvm.sh index 21f3b89..0e1c9dc 100755 --- a/nvm.sh +++ b/nvm.sh @@ -140,7 +140,7 @@ nvm_rc_version() { local NVMRC_PATH NVMRC_PATH="$(nvm_find_nvmrc)" if [ -e "$NVMRC_PATH" ]; then - read -r NVM_RC_VERSION < "$NVMRC_PATH" + read -r NVM_RC_VERSION < "$NVMRC_PATH" || printf '' echo "Found '$NVMRC_PATH' with version <$NVM_RC_VERSION>" else >&2 echo "No .nvmrc file found"