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

Code before:
          --*) ;;
          *)
            if [ -n "${1-}" ]; then
              PROVIDED_VERSION="$1"
            fi
          ;;
        esac
        shift
      done

      if [ -n "${NVM_LTS-}" ]; then
        VERSION="$(nvm_match_version "lts/${NVM_LTS:-*}")"
      elif [ -z "${PROVIDED_VERSION-}" ]; then
        # Get the .nvmrc version depending if quiet mode is on or not
        if [[ $NVM_USE_SILENT -ne 1 ]]; then
          nvm_rc_version
        else
          nvm_rc_version quiet
        fi
        if [ -n "${NVM_RC_VERSION-}" ]; then
          PROVIDED_VERSION="${NVM_RC_VERSION}"
          VERSION="$(nvm_version "${PROVIDED_VERSION}")"
        fi
        unset NVM_RC_VERSION
        if [ -z "${VERSION}" ]; then
          if [[ $NVM_USE_SILENT -ne 1 ]]; then
            nvm_err 'Please see `nvm --help` or https://github.com/nvm-sh/nvm#nvmrc for more information.'
          fi
          return 127
        fi
      else
        VERSION="$(nvm_match_version "${PROVIDED_VERSION}")"
      fi

      if [ -z "${VERSION}" ]; then
        if [[ $NVM_USE_SILENT -ne 1 ]]; then
          >&2 nvm --help
        fi
        return 127
      fi

      if [ "_${VERSION}" = '_system' ]; then
        if [ $NVM_USE_SILENT -ne 1 ]; then
          if nvm_has_system_node && nvm deactivate >/dev/null 2>&1; then
            if [ $NVM_USE_SILENT -ne 1 ]; then
              nvm_echo "Now using system version of node: $(node -v 2>/dev/null)$(nvm_print_npm_version)"
            fi
            return
          elif nvm_has_system_iojs && nvm deactivate >/dev/null 2>&1; then
            if [ $NVM_USE_SILENT -ne 1 ]; then
              nvm_echo "Now using system version of io.js: $(iojs --version 2>/dev/null)$(nvm_print_npm_version)"

Review comment (suggestion):
```suggestion
          if [ $NVM_USE_SILENT -ne 1 ]; then
```
double bracket syntax is only supported in bash; nvm supports POSIX.

Code after:
        esac
        shift
      done

      if [ -n "${NVM_LTS-}" ]; then
        VERSION="$(nvm_match_version "lts/${NVM_LTS:-*}")"
      elif [ -z "${PROVIDED_VERSION-}" ]; then
        NVM_SILENT="${NVM_SILENT:-0}" nvm_rc_version
        if [ -n "${NVM_RC_VERSION-}" ]; then
          PROVIDED_VERSION="${NVM_RC_VERSION}"
          VERSION="$(nvm_version "${PROVIDED_VERSION}")"
        fi
        unset NVM_RC_VERSION
        if [ -z "${VERSION}" ]; then
          nvm_err 'Please see `nvm --help` or https://github.com/nvm-sh/nvm#nvmrc for more information.'
          return 127
        fi
      else
        VERSION="$(nvm_match_version "${PROVIDED_VERSION}")"
      fi

      if [ -z "${VERSION}" ]; then
        >&2 nvm --help
        return 127
      fi

      if [ "_${VERSION}" = '_system' ]; then
        if nvm_has_system_node && nvm deactivate "${NVM_SILENT_ARG-}" >/dev/null 2>&1; then
          if [ "${NVM_SILENT:-0}" -ne 1 ]; then
            nvm_echo "Now using system version of node: $(node -v 2>/dev/null)$(nvm_print_npm_version)"
          fi
          return
        elif nvm_has_system_iojs && nvm deactivate "${NVM_SILENT_ARG-}" >/dev/null 2>&1; then
          if [ "${NVM_SILENT:-0}" -ne 1 ]; then
            nvm_echo "Now using system version of io.js: $(iojs --version 2>/dev/null)$(nvm_print_npm_version)"
          fi
          return
        elif [ "${NVM_SILENT:-0}" -ne 1 ]; then
          nvm_err 'System version of node not found.'
        fi
        return 127
      elif [ "_${VERSION}" = "_∞" ]; then
        if [ "${NVM_SILENT:-0}" -ne 1 ]; then
          nvm_err "The alias \"${PROVIDED_VERSION}\" leads to an infinite loop. Aborting."
        fi
        return 8
      fi
      if [ "${VERSION}" = 'N/A' ]; then
        if [ "${NVM_SILENT:-0}" -ne 1 ]; then
          nvm_err "N/A: version \"${PROVIDED_VERSION} -> ${VERSION}\" is not yet installed."
          nvm_err ""