Skip to content
Myr

[Fix] `install`: use darwin-x64 for all binary on mac for node < v16

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

authored by Rahul Beniwal · committed by Jordan Harband · parent b16fb6e · Browse files · 2 files+27 added−9 removed
This commit

State

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

Diff stats

2 files+27 added−9 removed

  • tests:+23 added−0 removed
  • other:+4 added−9 removed

2 files+27 added−9 removed

modified:test/fast/Unit tests/nvm_get_download_slug+23 added
108 unmodified lines
109ACTUAL="$(nvm_get_download_slug iojs source 15.99.99)"110EXPECTED="iojs-15.99.99"111[ "${ACTUAL}" = "${EXPECTED}" ] || die "expected >${EXPECTED}<, got >${ACTUAL}<"112113114REAL_OS="$(command uname -s 2>/dev/null || echo '')"115REAL_ARCH="$(command uname -m 2>/dev/null || echo '')"116if [ "${REAL_OS}" = "Darwin" ] && [ "${REAL_ARCH}" = "arm64" ]; then117 # Node < 16 uses x64 on darwin-arm64118 ACTUAL="$(nvm_get_download_slug node binary 14.21.3)"119 EXPECTED='node-14.21.3-darwin-x64'120 [ "${ACTUAL}" = "${EXPECTED}" ] || die "expected >${EXPECTED}<, got >${ACTUAL}<"121 ACTUAL="$(nvm_get_download_slug node binary 15.99.99)"122 EXPECTED='node-15.99.99-darwin-x64'123 [ "${ACTUAL}" = "${EXPECTED}" ] || die "expected >${EXPECTED}<, got >${ACTUAL}<"124 ACTUAL="$(nvm_get_download_slug iojs binary 15.99.99)"125 EXPECTED='iojs-15.99.99-darwin-x64'126 [ "${ACTUAL}" = "${EXPECTED}" ] || die "expected >${EXPECTED}<, got >${ACTUAL}<"127128 # Test Node >= 16 uses arm64 on darwin-arm64129 ACTUAL="$(nvm_get_download_slug node binary 16.0.0)"130 EXPECTED='node-16.0.0-darwin-arm64'131 [ "${ACTUAL}" = "${EXPECTED}" ] || die "expected >${EXPECTED}<, got >${ACTUAL}<"132 ACTUAL="$(nvm_get_download_slug node binary 18.0.0)"133 EXPECTED='node-18.0.0-darwin-arm64'134 [ "${ACTUAL}" = "${EXPECTED}" ] || die "expected >${EXPECTED}<, got >${ACTUAL}<"135fi
modified:nvm.sh+4 added-9 removed
2436 unmodified lines
2437 NVM_ARCH="arm-pi"2438 fi2439 fi24402441 # If running MAC M1 :: Node v14.17.0 was the first version to offer official experimental support:2442 # https://github.com/nodejs/node/issues/40126 (although binary distributions aren't available until v16)2443 if \2444 nvm_version_greater '14.17.0' "${VERSION}" \2445 || (nvm_version_greater_than_or_equal_to "${VERSION}" '15.0.0' && nvm_version_greater '16.0.0' "${VERSION}") \2446 ; then2447 if [ "_${NVM_OS}" = '_darwin' ] && [ "${NVM_ARCH}" = 'arm64' ]; then2448 NVM_ARCH=x642449 fi2441 # If running MAC M1 :: ARM64 binaries are not available for Node < 16.0.02442 # https://github.com/nodejs/node/issues/40126 (binary distributions aren't available until v16)2443 if nvm_version_greater '16.0.0' "${VERSION}" && [ "_${NVM_OS}" = '_darwin' ] && [ "${NVM_ARCH}" = 'arm64' ]; then2444 NVM_ARCH=x642445 fi24462447 if [ "${KIND}" = 'binary' ]; then2448 nvm_echo "${FLAVOR}-${VERSION}-${NVM_OS}-${NVM_ARCH}"
2434 unmodified lines