mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-07-18 21:08:23 +08:00
[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:
@@ -2251,7 +2251,7 @@ nvm_get_arch() {
|
||||
HOST_ARCH=armv7l
|
||||
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
|
||||
# See https://unofficial-builds.nodejs.org/download/release/
|
||||
case "${NVM_ARCH}" in
|
||||
|
||||
Reference in New Issue
Block a user