From ab77712867dac4ff1015427e3bf9aef0706b1b1a Mon Sep 17 00:00:00 2001 From: Yinan Qin Date: Sat, 25 Oct 2025 19:19:05 +0800 Subject: [PATCH] [New] `install`: add support for loongarch64 architecture --- nvm.sh | 1 + test/fast/Unit tests/nvm_get_arch | 2 ++ test/mocks/uname_linux_loongarch64 | 5 +++++ 3 files changed, 8 insertions(+) create mode 100755 test/mocks/uname_linux_loongarch64 diff --git a/nvm.sh b/nvm.sh index 4c30e215..192ffe8d 100755 --- a/nvm.sh +++ b/nvm.sh @@ -2183,6 +2183,7 @@ nvm_get_arch() { x86_64 | amd64) NVM_ARCH="x64" ;; i*86) NVM_ARCH="x86" ;; aarch64 | armv8l) NVM_ARCH="arm64" ;; + loongarch64) NVM_ARCH="loong64" ;; *) NVM_ARCH="${HOST_ARCH}" ;; esac diff --git a/test/fast/Unit tests/nvm_get_arch b/test/fast/Unit tests/nvm_get_arch index b759b594..a52be661 100755 --- a/test/fast/Unit tests/nvm_get_arch +++ b/test/fast/Unit tests/nvm_get_arch @@ -93,4 +93,6 @@ run_test amd64 osx x64 run_test arm64 smartos x64 run_test armv8l smartos x64 +run_test loongarch64 linux loong64 + cleanup diff --git a/test/mocks/uname_linux_loongarch64 b/test/mocks/uname_linux_loongarch64 new file mode 100755 index 00000000..34f9529f --- /dev/null +++ b/test/mocks/uname_linux_loongarch64 @@ -0,0 +1,5 @@ +if [ "_$1" = "_-m" ]; then + echo "loongarch64" +else + echo "Linux foo 6.12.54-16k #0 SMP PREEMPT_DYNAMIC Fri Dec 5 12:35:43 UTC loongarch64 GNU/Linux" +fi