Repository: nvm-sh/nvm
File: nvm.sh (Shell)

Code before:
# Obtain the nvm version from the .nvmrc file
nvm_rc_version() {
  # Check if quiet mode is on
  local quiet="false"
  if [ "$1" == "--silent" ]; then
    quiet="true"
  fi
  # Set NVM_RC_VERSION to null before we set it ourselves
  export NVM_RC_VERSION=''
  # Check where .nvmrc exists
  local NVMRC_PATH
  NVMRC_PATH="$(nvm_find_nvmrc)"
  # Give an error if the .nvmrc doesn't exist
  if [ ! -e "${NVMRC_PATH}" ]; then
    # Give an error only if quiet mode is off
    if [ "$quiet" == "false" ]; then
      nvm_err "No .nvmrc file found"
    fi
    return 1
  fi
  # Read the .nvmrc file
  NVM_RC_VERSION="$(command head -n 1 "${NVMRC_PATH}" | command tr -d '\r')" || command printf ''
  # Check if .nvmrc is empty
  if [ -z "${NVM_RC_VERSION}" ]; then
    # Give error only if quiet mode is off
    if [ "$quiet" == "false" ]; then
      nvm_err "Warning: empty .nvmrc file found at \"${NVMRC_PATH}\""
    fi
    return 2
  fi
  # Echo the contents of .nvmrc and where it was found if quiet mode is off
  if [ "$quiet" == "false" ]; then
    nvm_echo "Found '${NVMRC_PATH}' with version <${NVM_RC_VERSION}>"
  fi
}

nvm_clang_version() {
  clang --version | command awk '{ if ($2 == "version") print $3; else if ($3 == "version") print $4 }' | command sed 's/-.*$//g'
}

nvm_curl_version() {
  curl -V | command awk '{ if ($1 == "curl") print $2 }' | command sed 's/-.*$//g'
}

nvm_version_greater() {
  command awk 'BEGIN {
    if (ARGV[1] == "" || ARGV[2] == "") exit(1)
    split(ARGV[1], a, /\./);
    split(ARGV[2], b, /\./);
    for (i=1; i<=3; i++) {
      if (a[i] && a[i] !~ /^[0-9]+$/) exit(2);

Review comment (suggestion):
```suggestion
    if [ "${NVM_USE_SILENT}" != true ]; then
```

Code after:
# Obtain nvm version from rc file
nvm_rc_version() {
  export NVM_RC_VERSION=''
  local NVMRC_PATH
  NVMRC_PATH="$(nvm_find_nvmrc)"
  if [ ! -e "${NVMRC_PATH}" ]; then
    if [ "${NVM_SILENT:-0}" -ne 1 ]; then
      nvm_err "No .nvmrc file found"
    fi
    return 1
  fi
  NVM_RC_VERSION="$(command head -n 1 "${NVMRC_PATH}" | command tr -d '\r')" || command printf ''
  if [ -z "${NVM_RC_VERSION}" ]; then
    if [ "${NVM_SILENT:-0}" -ne 1 ]; then
      nvm_err "Warning: empty .nvmrc file found at \"${NVMRC_PATH}\""
    fi
    return 2
  fi
  if [ "${NVM_SILENT:-0}" -ne 1 ]; then
    nvm_echo "Found '${NVMRC_PATH}' with version <${NVM_RC_VERSION}>"
  fi
}

nvm_clang_version() {
  clang --version | command awk '{ if ($2 == "version") print $3; else if ($3 == "version") print $4 }' | command sed 's/-.*$//g'
}

nvm_curl_version() {
  curl -V | command awk '{ if ($1 == "curl") print $2 }' | command sed 's/-.*$//g'
}

nvm_version_greater() {
  command awk 'BEGIN {
    if (ARGV[1] == "" || ARGV[2] == "") exit(1)
    split(ARGV[1], a, /\./);
    split(ARGV[2], b, /\./);
    for (i=1; i<=3; i++) {
      if (a[i] && a[i] !~ /^[0-9]+$/) exit(2);
      if (b[i] && b[i] !~ /^[0-9]+$/) { exit(0); }
      if (a[i] < b[i]) exit(3);
      else if (a[i] > b[i]) exit(0);
    }
    exit(4)
  }' "${1#v}" "${2#v}"
}

nvm_version_greater_than_or_equal_to() {
  command awk 'BEGIN {
    if (ARGV[1] == "" || ARGV[2] == "") exit(1)
    split(ARGV[1], a, /\./);
    split(ARGV[2], b, /\./);