[Robustness] nvm_get_arch: only apply the Alpine musl suffix when the OS is linux

The `/etc/alpine-release` check applied the -musl suffix regardless of the resolved OS.
In practice Alpine is always linux, so this is behavior-neutral, but it also makes the `nvm_get_arch` unit test hermetic: its mocked smartos/osx cases no longer pick up a real host's Alpine marker.
This commit is contained in:
Jordan Harband
2026-07-14 23:10:33 -07:00
parent ce157c1171
commit 86c937436d
+1 -1
View File
@@ -2251,7 +2251,7 @@ nvm_get_arch() {
HOST_ARCH=armv7l HOST_ARCH=armv7l
fi fi
if [ -f "/etc/alpine-release" ]; then if [ -f "/etc/alpine-release" ] && [ "_${NVM_OS}" = "_linux" ]; then
# Alpine Linux uses musl libc; map to musl variants where available # Alpine Linux uses musl libc; map to musl variants where available
# See https://unofficial-builds.nodejs.org/download/release/ # See https://unofficial-builds.nodejs.org/download/release/
case "${NVM_ARCH}" in case "${NVM_ARCH}" in