ronantakizawa/codereview-bench huggingface dataset:
Repository: nvm-sh/nvm
File: nvm.sh (Shell)

Code before:
      fi

      local nobinary
      local noprogress
      nobinary=0
      noprogress=0
      local LTS
      local ALIAS
      local NVM_UPGRADE_NPM
      NVM_UPGRADE_NPM=0

      local PROVIDED_REINSTALL_PACKAGES_FROM
      local REINSTALL_PACKAGES_FROM
      local SKIP_DEFAULT_PACKAGES
      local DEFAULT_PACKAGES

      while [ $# -ne 0 ]; do
        case "$1" in
          ---*)
            nvm_err 'arguments with `---` are not supported - this is likely a typo'
            return 55;
          ;;
          -s)
            shift # consume "-s"
            nobinary=1
            if ["${nosource}" -eq 1]; then
               nvm err '-s and -b cannot be set together since they would skip install from both binary and source'
               return 6
            fi   
          ;;
          -b)
            shift #consume "-b"
            nosource=1
            if ["${nobinary}" -eq 1]; then
               nvm err '-s and -b cannot be set together since they would skip install from both binary and source'
               return 6
            fi  
          -j)
            shift # consume "-j"
            nvm_get_make_jobs "$1"
            shift # consume job count
          ;;
          --no-progress)
            noprogress=1
            shift
          ;;
          --lts)
            LTS='*'
            shift
          ;;
          --lts=*)

Review comment (suggestion):
```suggestion
            if [ $nosource -eq 1 ]; then
```
quotes aren't needed for -eq

Code after:
        version_not_provided=1
      fi

      local nobinary
      local nosource
      local noprogress
      nobinary=0
      noprogress=0
      nosource=0
      local LTS
      local ALIAS
      local NVM_UPGRADE_NPM
      NVM_UPGRADE_NPM=0

      local PROVIDED_REINSTALL_PACKAGES_FROM
      local REINSTALL_PACKAGES_FROM
      local SKIP_DEFAULT_PACKAGES
      local DEFAULT_PACKAGES

      while [ $# -ne 0 ]; do
        case "$1" in
          ---*)
            nvm_err 'arguments with `---` are not supported - this is likely a typo'
            return 55;
          ;;
          -s)
            shift # consume "-s"
            nobinary=1
            if [ $nosource -eq 1 ]; then
                nvm err '-s and -b cannot be set together since they would skip install from both binary and source'
                return 6
            fi
          ;;
          -b)
            shift # consume "-b"
            nosource=1
            if [ $nobinary -eq 1 ]; then
                nvm err '-s and -b cannot be set together since they would skip install from both binary and source'
                return 6
            fi
          ;;
          -j)
            shift # consume "-j"
            nvm_get_make_jobs "$1"
            shift # consume job count
          ;;
          --no-progress)
            noprogress=1
            shift
          ;;
          --lts)
Repository: nvm-sh/nvm
File: nvm.sh (Shell)

Code before:
      local NVM_UPGRADE_NPM
      NVM_UPGRADE_NPM=0

      local PROVIDED_REINSTALL_PACKAGES_FROM
      local REINSTALL_PACKAGES_FROM
      local SKIP_DEFAULT_PACKAGES
      local DEFAULT_PACKAGES

      while [ $# -ne 0 ]; do
        case "$1" in
          ---*)
            nvm_err 'arguments with `---` are not supported - this is likely a typo'
            return 55;
          ;;
          -s)
            shift # consume "-s"
            nobinary=1
            if ["${nosource}" -eq 1]; then
               nvm err '-s and -b cannot be set together since they would skip install from both binary and source'
               return 6
            fi   
          ;;
          -b)
            shift #consume "-b"
            nosource=1
            if ["${nobinary}" -eq 1]; then
               nvm err '-s and -b cannot be set together since they would skip install from both binary and source'
               return 6
            fi  
          -j)
            shift # consume "-j"
            nvm_get_make_jobs "$1"
            shift # consume job count
          ;;
          --no-progress)
            noprogress=1
            shift
          ;;
          --lts)
            LTS='*'
            shift
          ;;
          --lts=*)
            LTS="${1##--lts=}"
            shift
          ;;
          --latest-npm)
            NVM_UPGRADE_NPM=1
            shift
          ;;
          --default)

Review comment (suggestion):
```suggestion
            if [ $nobinary -eq 1 ]; then
```

Code after:
      nosource=0
      local LTS
      local ALIAS
      local NVM_UPGRADE_NPM
      NVM_UPGRADE_NPM=0

      local PROVIDED_REINSTALL_PACKAGES_FROM
      local REINSTALL_PACKAGES_FROM
      local SKIP_DEFAULT_PACKAGES
      local DEFAULT_PACKAGES

      while [ $# -ne 0 ]; do
        case "$1" in
          ---*)
            nvm_err 'arguments with `---` are not supported - this is likely a typo'
            return 55;
          ;;
          -s)
            shift # consume "-s"
            nobinary=1
            if [ $nosource -eq 1 ]; then
                nvm err '-s and -b cannot be set together since they would skip install from both binary and source'
                return 6
            fi
          ;;
          -b)
            shift # consume "-b"
            nosource=1
            if [ $nobinary -eq 1 ]; then
                nvm err '-s and -b cannot be set together since they would skip install from both binary and source'
                return 6
            fi
          ;;
          -j)
            shift # consume "-j"
            nvm_get_make_jobs "$1"
            shift # consume job count
          ;;
          --no-progress)
            noprogress=1
            shift
          ;;
          --lts)
            LTS='*'
            shift
          ;;
          --lts=*)
            LTS="${1##--lts=}"
            shift
          ;;
          --latest-npm)
Repository: nvm-sh/nvm
File: nvm.sh (Shell)

Code before:
  return 0
}

# args: flavor, type, version, reinstall
nvm_install_binary() {
  local FLAVOR
  case "${1-}" in
    node | iojs) FLAVOR="${1}" ;;
    *)
      nvm_err 'supported flavors: node, iojs'
      return 4
    ;;
  esac

  local TYPE
  TYPE="${2-}"

  local PREFIXED_VERSION
  PREFIXED_VERSION="${3-}"
  if [ -z "${PREFIXED_VERSION}" ]; then
    nvm_err 'A version number is required.'
    return 3
  fi

  local nosource
  nosource = "${4-}"

  local VERSION
  VERSION="$(nvm_strip_iojs_prefix "${PREFIXED_VERSION}")"

  local NVM_OS
  NVM_OS="$(nvm_get_os)"

  if [ -z "${NVM_OS}" ]; then
    return 2
  fi

  local TARBALL
  local TMPDIR

  local PROGRESS_BAR
  local NODE_OR_IOJS
  if [ "${FLAVOR}" = 'node' ]; then
    NODE_OR_IOJS="${FLAVOR}"
  elif [ "${FLAVOR}" = 'iojs' ]; then
    NODE_OR_IOJS="io.js"
  fi
  if [ "${NVM_NO_PROGRESS-}" = "1" ]; then
    # --silent, --show-error, use short option as @samrocketman mentions the compatibility issue.
    PROGRESS_BAR="-sS"
  else

Review comment (suggestion):
```suggestion
  nosource="${4-}"
```
assignments won't work if there's spaces around the =

Code after:
  return 0
}

# args: flavor, type, version, reinstall
nvm_install_binary() {
  local FLAVOR
  case "${1-}" in
    node | iojs) FLAVOR="${1}" ;;
    *)
      nvm_err 'supported flavors: node, iojs'
      return 4
    ;;
  esac

  local TYPE
  TYPE="${2-}"

  local PREFIXED_VERSION
  PREFIXED_VERSION="${3-}"
  if [ -z "${PREFIXED_VERSION}" ]; then
    nvm_err 'A version number is required.'
    return 3
  fi

  local nosource
  nosource="${4-}"

  local VERSION
  VERSION="$(nvm_strip_iojs_prefix "${PREFIXED_VERSION}")"

  local NVM_OS
  NVM_OS="$(nvm_get_os)"

  if [ -z "${NVM_OS}" ]; then
    return 2
  fi

  local TARBALL
  local TMPDIR

  local PROGRESS_BAR
  local NODE_OR_IOJS
  if [ "${FLAVOR}" = 'node' ]; then
    NODE_OR_IOJS="${FLAVOR}"
  elif [ "${FLAVOR}" = 'iojs' ]; then
    NODE_OR_IOJS="io.js"
  fi
  if [ "${NVM_NO_PROGRESS-}" = "1" ]; then
    # --silent, --show-error, use short option as @samrocketman mentions the compatibility issue.
    PROGRESS_BAR="-sS"
  else
Repository: nvm-sh/nvm
File: nvm.sh (Shell)

Code before:
    NODE_OR_IOJS="io.js"
  fi
  if [ "${NVM_NO_PROGRESS-}" = "1" ]; then
    # --silent, --show-error, use short option as @samrocketman mentions the compatibility issue.
    PROGRESS_BAR="-sS"
  else
    PROGRESS_BAR="--progress-bar"
  fi
  nvm_echo "Downloading and installing ${NODE_OR_IOJS-} ${VERSION}..."
  TARBALL="$(PROGRESS_BAR="${PROGRESS_BAR}" nvm_download_artifact "${FLAVOR}" binary "${TYPE-}" "${VERSION}" | command tail -1)"
  if [ -f "${TARBALL}" ]; then
    TMPDIR="$(dirname "${TARBALL}")/files"
  fi

  if nvm_install_binary_extract "${NVM_OS}" "${PREFIXED_VERSION}" "${VERSION}" "${TARBALL}" "${TMPDIR}"; then
    if [ -n "${ALIAS-}" ]; then
      nvm alias "${ALIAS}" "${provided_version}"
    fi
    return 0
  fi


  # Read nosource from arguments
  if [ $nosource -eq 1]; then
      nvm_err "Binary download failed"
      return 0

  nvm_err 'Binary download failed, trying source.'
  if [ -n "${TMPDIR-}" ]; then
    command rm -rf "${TMPDIR}"
  fi
  return 1
}

# args: flavor, kind, version
nvm_get_download_slug() {
  local FLAVOR
  case "${1-}" in
    node | iojs) FLAVOR="${1}" ;;
    *)
      nvm_err 'supported flavors: node, iojs'
      return 1
    ;;
  esac

  local KIND
  case "${2-}" in
    binary | source) KIND="${2}" ;;
    *)
      nvm_err 'supported kinds: binary, source'
      return 2

Review comment (bug):
```suggestion
  if [ $nosource -eq 1 ]; then
      nvm_err "Binary download failed"
      return 0
  fi
```

Code after:
    NODE_OR_IOJS="io.js"
  fi
  if [ "${NVM_NO_PROGRESS-}" = "1" ]; then
    # --silent, --show-error, use short option as @samrocketman mentions the compatibility issue.
    PROGRESS_BAR="-sS"
  else
    PROGRESS_BAR="--progress-bar"
  fi
  nvm_echo "Downloading and installing ${NODE_OR_IOJS-} ${VERSION}..."
  TARBALL="$(PROGRESS_BAR="${PROGRESS_BAR}" nvm_download_artifact "${FLAVOR}" binary "${TYPE-}" "${VERSION}" | command tail -1)"
  if [ -f "${TARBALL}" ]; then
    TMPDIR="$(dirname "${TARBALL}")/files"
  fi

  if nvm_install_binary_extract "${NVM_OS}" "${PREFIXED_VERSION}" "${VERSION}" "${TARBALL}" "${TMPDIR}"; then
    if [ -n "${ALIAS-}" ]; then
      nvm alias "${ALIAS}" "${provided_version}"
    fi
    return 0
  fi


  # Read nosource from arguments
  if [ "${nosource-}" = '1' ]; then
      nvm_err 'Binary download failed. Download from source aborted.'
      return 0
  fi

  nvm_err 'Binary download failed, trying source.'
  if [ -n "${TMPDIR-}" ]; then
    command rm -rf "${TMPDIR}"
  fi
  return 1
}

# args: flavor, kind, version
nvm_get_download_slug() {
  local FLAVOR
  case "${1-}" in
    node | iojs) FLAVOR="${1}" ;;
    *)
      nvm_err 'supported flavors: node, iojs'
      return 1
    ;;
  esac

  local KIND
  case "${2-}" in
    binary | source) KIND="${2}" ;;
    *)
      nvm_err 'supported kinds: binary, source'
Repository: nvm-sh/nvm
File: nvm.sh (Shell)

Code before:
  elif [ "${FLAVOR}" = 'iojs' ]; then
    NODE_OR_IOJS="io.js"
  fi
  if [ "${NVM_NO_PROGRESS-}" = "1" ]; then
    # --silent, --show-error, use short option as @samrocketman mentions the compatibility issue.
    PROGRESS_BAR="-sS"
  else
    PROGRESS_BAR="--progress-bar"
  fi
  nvm_echo "Downloading and installing ${NODE_OR_IOJS-} ${VERSION}..."
  TARBALL="$(PROGRESS_BAR="${PROGRESS_BAR}" nvm_download_artifact "${FLAVOR}" binary "${TYPE-}" "${VERSION}" | command tail -1)"
  if [ -f "${TARBALL}" ]; then
    TMPDIR="$(dirname "${TARBALL}")/files"
  fi

  if nvm_install_binary_extract "${NVM_OS}" "${PREFIXED_VERSION}" "${VERSION}" "${TARBALL}" "${TMPDIR}"; then
    if [ -n "${ALIAS-}" ]; then
      nvm alias "${ALIAS}" "${provided_version}"
    fi
    return 0
  fi


  # Read nosource from arguments
  if [ "$nosource" -eq 1 ]; then
      nvm_err "Binary download failed.Download from source aborted"
      return 0
  fi

  nvm_err 'Binary download failed, trying source.'
  if [ -n "${TMPDIR-}" ]; then
    command rm -rf "${TMPDIR}"
  fi
  return 1
}

# args: flavor, kind, version
nvm_get_download_slug() {
  local FLAVOR
  case "${1-}" in
    node | iojs) FLAVOR="${1}" ;;
    *)
      nvm_err 'supported flavors: node, iojs'
      return 1
    ;;
  esac

  local KIND
  case "${2-}" in
    binary | source) KIND="${2}" ;;
    *)

Review comment (bug):
```suggestion
      nvm_err 'Binary download failed. Download from source aborted.'
```

Code after:
  elif [ "${FLAVOR}" = 'iojs' ]; then
    NODE_OR_IOJS="io.js"
  fi
  if [ "${NVM_NO_PROGRESS-}" = "1" ]; then
    # --silent, --show-error, use short option as @samrocketman mentions the compatibility issue.
    PROGRESS_BAR="-sS"
  else
    PROGRESS_BAR="--progress-bar"
  fi
  nvm_echo "Downloading and installing ${NODE_OR_IOJS-} ${VERSION}..."
  TARBALL="$(PROGRESS_BAR="${PROGRESS_BAR}" nvm_download_artifact "${FLAVOR}" binary "${TYPE-}" "${VERSION}" | command tail -1)"
  if [ -f "${TARBALL}" ]; then
    TMPDIR="$(dirname "${TARBALL}")/files"
  fi

  if nvm_install_binary_extract "${NVM_OS}" "${PREFIXED_VERSION}" "${VERSION}" "${TARBALL}" "${TMPDIR}"; then
    if [ -n "${ALIAS-}" ]; then
      nvm alias "${ALIAS}" "${provided_version}"
    fi
    return 0
  fi


  # Read nosource from arguments
  if [ "${nosource-}" = '1' ]; then
      nvm_err 'Binary download failed. Download from source aborted.'
      return 0
  fi

  nvm_err 'Binary download failed, trying source.'
  if [ -n "${TMPDIR-}" ]; then
    command rm -rf "${TMPDIR}"
  fi
  return 1
}

# args: flavor, kind, version
nvm_get_download_slug() {
  local FLAVOR
  case "${1-}" in
    node | iojs) FLAVOR="${1}" ;;
    *)
      nvm_err 'supported flavors: node, iojs'
      return 1
    ;;
  esac

  local KIND
  case "${2-}" in
    binary | source) KIND="${2}" ;;
    *)
Repository: nvm-sh/nvm
File: nvm.sh (Shell)

Code before:
    NODE_OR_IOJS="${FLAVOR}"
  elif [ "${FLAVOR}" = 'iojs' ]; then
    NODE_OR_IOJS="io.js"
  fi
  if [ "${NVM_NO_PROGRESS-}" = "1" ]; then
    # --silent, --show-error, use short option as @samrocketman mentions the compatibility issue.
    PROGRESS_BAR="-sS"
  else
    PROGRESS_BAR="--progress-bar"
  fi
  nvm_echo "Downloading and installing ${NODE_OR_IOJS-} ${VERSION}..."
  TARBALL="$(PROGRESS_BAR="${PROGRESS_BAR}" nvm_download_artifact "${FLAVOR}" binary "${TYPE-}" "${VERSION}" | command tail -1)"
  if [ -f "${TARBALL}" ]; then
    TMPDIR="$(dirname "${TARBALL}")/files"
  fi

  if nvm_install_binary_extract "${NVM_OS}" "${PREFIXED_VERSION}" "${VERSION}" "${TARBALL}" "${TMPDIR}"; then
    if [ -n "${ALIAS-}" ]; then
      nvm alias "${ALIAS}" "${provided_version}"
    fi
    return 0
  fi


  # Read nosource from arguments
  if [ "$nosource" -eq 1 ]; then
      nvm_err "Binary download failed.Download from source aborted"
      return 0
  fi

  nvm_err 'Binary download failed, trying source.'
  if [ -n "${TMPDIR-}" ]; then
    command rm -rf "${TMPDIR}"
  fi
  return 1
}

# args: flavor, kind, version
nvm_get_download_slug() {
  local FLAVOR
  case "${1-}" in
    node | iojs) FLAVOR="${1}" ;;
    *)
      nvm_err 'supported flavors: node, iojs'
      return 1
    ;;
  esac

  local KIND
  case "${2-}" in
    binary | source) KIND="${2}" ;;

Review comment (suggestion):
```suggestion
  if [ "${nosource-}" = '1' ]; then
```
i think this one's a string at this point

Code after:
    NODE_OR_IOJS="${FLAVOR}"
  elif [ "${FLAVOR}" = 'iojs' ]; then
    NODE_OR_IOJS="io.js"
  fi
  if [ "${NVM_NO_PROGRESS-}" = "1" ]; then
    # --silent, --show-error, use short option as @samrocketman mentions the compatibility issue.
    PROGRESS_BAR="-sS"
  else
    PROGRESS_BAR="--progress-bar"
  fi
  nvm_echo "Downloading and installing ${NODE_OR_IOJS-} ${VERSION}..."
  TARBALL="$(PROGRESS_BAR="${PROGRESS_BAR}" nvm_download_artifact "${FLAVOR}" binary "${TYPE-}" "${VERSION}" | command tail -1)"
  if [ -f "${TARBALL}" ]; then
    TMPDIR="$(dirname "${TARBALL}")/files"
  fi

  if nvm_install_binary_extract "${NVM_OS}" "${PREFIXED_VERSION}" "${VERSION}" "${TARBALL}" "${TMPDIR}"; then
    if [ -n "${ALIAS-}" ]; then
      nvm alias "${ALIAS}" "${provided_version}"
    fi
    return 0
  fi


  # Read nosource from arguments
  if [ "${nosource-}" = '1' ]; then
      nvm_err 'Binary download failed. Download from source aborted.'
      return 0
  fi

  nvm_err 'Binary download failed, trying source.'
  if [ -n "${TMPDIR-}" ]; then
    command rm -rf "${TMPDIR}"
  fi
  return 1
}

# args: flavor, kind, version
nvm_get_download_slug() {
  local FLAVOR
  case "${1-}" in
    node | iojs) FLAVOR="${1}" ;;
    *)
      nvm_err 'supported flavors: node, iojs'
      return 1
    ;;
  esac

  local KIND
  case "${2-}" in
    binary | source) KIND="${2}" ;;
Repository: nvm-sh/nvm
File: nvm.sh (Shell)

Code before:
    CYGWIN* | MSYS* | MINGW*) NVM_OS=win ;;
  esac
  nvm_echo "${NVM_OS-}"
}

nvm_get_arch() {
  local HOST_ARCH
  local NVM_OS
  local EXIT_CODE

  NVM_OS="$(nvm_get_os)"
  # If the OS is SunOS, first try to use pkgsrc to guess
  # the most appropriate arch. If it's not available, use
  # isainfo to get the instruction set supported by the
  # kernel.
  if [ "_${NVM_OS}" = "_sunos" ]; then
    if HOST_ARCH=$(pkg_info -Q MACHINE_ARCH pkg_install); then
      HOST_ARCH=$(nvm_echo "${HOST_ARCH}" | command tail -1)
    else
      HOST_ARCH=$(isainfo -n)
    fi
  elif [ "_${NVM_OS}" = "_aix" ]; then
    HOST_ARCH=ppc64
  else
    # If running MAC M1 :: arm64 ARCH and Darwin OS then use "x64" Architecture because node doesn't provide darwin_arm64 package
    if [[ "_${NVM_OS}" == "_darwin" && "$(command uname -m)" == "arm64" ]]; then
      HOST_ARCH=x86_64
    else
      HOST_ARCH="$(command uname -m)"
    fi
  fi

  local NVM_ARCH
  case "${HOST_ARCH}" in
    x86_64 | amd64) NVM_ARCH="x64" ;;
    i*86) NVM_ARCH="x86" ;;
    aarch64) NVM_ARCH="arm64" ;;
    *) NVM_ARCH="${HOST_ARCH}" ;;
  esac

  # If running a 64bit ARM kernel but a 32bit ARM userland, change ARCH to 32bit ARM (armv7l)
  L=$(ls -dl /sbin/init 2>/dev/null) # if /sbin/init is 32bit executable
  if [ "$(uname)" = "Linux" ] && [ "${NVM_ARCH}" = arm64 ] && [ "$(od -An -t x1 -j 4 -N 1 "${L#*-> }")" = ' 01' ]; then
    NVM_ARCH=armv7l
    HOST_ARCH=armv7l
  fi

  nvm_echo "${NVM_ARCH}"
}

nvm_get_minor_version() {

Review comment (suggestion):
this is bash-specific syntax; nvm supports POSIX.
```suggestion
    if [ "_${NVM_OS}" = '_darwin' && "$(command uname -m)" = 'arm64' ]; then
```

Code after:
    CYGWIN* | MSYS* | MINGW*) NVM_OS=win ;;
  esac
  nvm_echo "${NVM_OS-}"
}

nvm_get_arch() {
  local HOST_ARCH
  local NVM_OS
  local EXIT_CODE

  NVM_OS="$(nvm_get_os)"
  # If the OS is SunOS, first try to use pkgsrc to guess
  # the most appropriate arch. If it's not available, use
  # isainfo to get the instruction set supported by the
  # kernel.
  if [ "_${NVM_OS}" = "_sunos" ]; then
    if HOST_ARCH=$(pkg_info -Q MACHINE_ARCH pkg_install); then
      HOST_ARCH=$(nvm_echo "${HOST_ARCH}" | command tail -1)
    else
      HOST_ARCH=$(isainfo -n)
    fi
  elif [ "_${NVM_OS}" = "_aix" ]; then
    HOST_ARCH=ppc64
  else
    HOST_ARCH="$(command uname -m)"
  fi

  local NVM_ARCH
  case "${HOST_ARCH}" in
    x86_64 | amd64) NVM_ARCH="x64" ;;
    i*86) NVM_ARCH="x86" ;;
    aarch64) NVM_ARCH="arm64" ;;
    *) NVM_ARCH="${HOST_ARCH}" ;;
  esac

  # If running a 64bit ARM kernel but a 32bit ARM userland, change ARCH to 32bit ARM (armv7l)
  L=$(ls -dl /sbin/init 2>/dev/null) # if /sbin/init is 32bit executable
  if [ "$(uname)" = "Linux" ] && [ "${NVM_ARCH}" = arm64 ] && [ "$(od -An -t x1 -j 4 -N 1 "${L#*-> }")" = ' 01' ]; then
    NVM_ARCH=armv7l
    HOST_ARCH=armv7l
  fi

  nvm_echo "${NVM_ARCH}"
}

nvm_get_minor_version() {
  local VERSION
  VERSION="$1"

  if [ -z "${VERSION}" ]; then
    nvm_err 'a version is required'
Repository: nvm-sh/nvm
File: nvm.sh (Shell)

Code before:
  local KIND
  case "${2-}" in
    binary | source) KIND="${2}" ;;
    *)
      nvm_err 'supported kinds: binary, source'
      return 2
    ;;
  esac

  local VERSION
  VERSION="${3-}"

  local NVM_OS
  NVM_OS="$(nvm_get_os)"

  local NVM_ARCH
  NVM_ARCH="$(nvm_get_arch)"
  if ! nvm_is_merged_node_version "${VERSION}"; then
    if [ "${NVM_ARCH}" = 'armv6l' ] || [ "${NVM_ARCH}" = 'armv7l' ]; then
      NVM_ARCH="arm-pi"
    fi
  fi

  # If node version in below 16.0.0 then there is no arm64 packages available in nod erepositories, so we have to install "x64" arch packages
  # If running MAC M1 :: arm64 ARCH and Darwin OS then use "x64" Architecture because node doesn't provide darwin_arm64 package
  if ! nvm_version_greater_than_or_equal_to "${VERSION}" 16.0.0; then
    if [ "_${NVM_OS}" = '_darwin' ] && [ "${NVM_ARCH}" = 'arm64' ]; then
      NVM_ARCH=x64
    fi
  fi

  if [ "${KIND}" = 'binary' ]; then
    nvm_echo "${FLAVOR}-${VERSION}-${NVM_OS}-${NVM_ARCH}"
  elif [ "${KIND}" = 'source' ]; then
    nvm_echo "${FLAVOR}-${VERSION}"
  fi
}

nvm_get_artifact_compression() {
  local VERSION
  VERSION="${1-}"

  local NVM_OS
  NVM_OS="$(nvm_get_os)"

  local COMPRESSION
  COMPRESSION='tar.gz'
  if [ "_${NVM_OS}" = '_win' ]; then
    COMPRESSION='zip'
  elif nvm_supports_xz "${VERSION}"; then
    COMPRESSION='tar.xz'

Review comment (suggestion):
```suggestion
  if nvm_version_greater_than_or_equal_to '16.0.0' "${VERSION}"; then
```
i think this needs to be inverted so that 16.0.0 is included? tricky to be sure without testing it.

Code after:
  local KIND
  case "${2-}" in
    binary | source) KIND="${2}" ;;
    *)
      nvm_err 'supported kinds: binary, source'
      return 2
    ;;
  esac

  local VERSION
  VERSION="${3-}"

  local NVM_OS
  NVM_OS="$(nvm_get_os)"

  local NVM_ARCH
  NVM_ARCH="$(nvm_get_arch)"
  if ! nvm_is_merged_node_version "${VERSION}"; then
    if [ "${NVM_ARCH}" = 'armv6l' ] || [ "${NVM_ARCH}" = 'armv7l' ]; then
      NVM_ARCH="arm-pi"
    fi
  fi

  # If node version in below 16.0.0 then there is no arm64 packages available in node repositories, so we have to install "x64" arch packages
  # If running MAC M1 :: arm64 arch and Darwin OS then use "x64" Architecture because node doesn't provide darwin_arm64 package below v16.0.0
  if nvm_version_greater '16.0.0' "${VERSION}"; then
    if [ "_${NVM_OS}" = '_darwin' ] && [ "${NVM_ARCH}" = 'arm64' ]; then
      NVM_ARCH=x64
    fi
  fi

  if [ "${KIND}" = 'binary' ]; then
    nvm_echo "${FLAVOR}-${VERSION}-${NVM_OS}-${NVM_ARCH}"
  elif [ "${KIND}" = 'source' ]; then
    nvm_echo "${FLAVOR}-${VERSION}"
  fi
}

nvm_get_artifact_compression() {
  local VERSION
  VERSION="${1-}"

  local NVM_OS
  NVM_OS="$(nvm_get_os)"

  local COMPRESSION
  COMPRESSION='tar.gz'
  if [ "_${NVM_OS}" = '_win' ]; then
    COMPRESSION='zip'
  elif nvm_supports_xz "${VERSION}"; then
    COMPRESSION='tar.xz'