From 423f4208840bd0035717a6c4d0fdf8fae9c7664d Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Mon, 28 Nov 2016 03:34:40 +0800 Subject: [PATCH 1/2] [New] Add one more NVM_OS - alpine_linux --- nvm.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nvm.sh b/nvm.sh index 0e19598..e475194 100755 --- a/nvm.sh +++ b/nvm.sh @@ -1443,7 +1443,13 @@ nvm_get_os() { NVM_UNAME="$(command uname -a)" local NVM_OS case "$NVM_UNAME" in - Linux\ *) NVM_OS=linux ;; + Linux\ *) + if [ -f "/etc/alpine-release" ]; then + NVM_OS=alpine_linux + else + NVM_OS=linux + fi + ;; Darwin\ *) NVM_OS=darwin ;; SunOS\ *) NVM_OS=sunos ;; FreeBSD\ *) NVM_OS=freebsd ;; @@ -1779,7 +1785,7 @@ nvm_get_make_jobs() { NVM_OS="$(nvm_get_os)" local NVM_CPU_CORES case "_$NVM_OS" in - "_linux") + '_linux' | '_alpine_linux') NVM_CPU_CORES="$(nvm_grep -c -E '^processor.+: [0-9]+' /proc/cpuinfo)" ;; "_freebsd" | "_darwin") From f25860861caea36ab948853852aab82ec0ff7fbd Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Wed, 30 Nov 2016 19:15:06 +0800 Subject: [PATCH 2/2] [New] Set nobinary=1 for Alpine Linux before nodejs provides it --- nvm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvm.sh b/nvm.sh index e475194..9990527 100755 --- a/nvm.sh +++ b/nvm.sh @@ -2434,8 +2434,8 @@ nvm() { NVM_INSTALL_SUCCESS=true else - if [ "_$NVM_OS" = "_freebsd" ]; then - # node.js and io.js do not have a FreeBSD binary + if [ "_$NVM_OS" = "_freebsd" ] || [ "_$NVM_OS" = "_alpine_linux" ]; then + # node.js and io.js do not have a FreeBSD / Alpine linux binary nobinary=1 nvm_err "Currently, there is no binary for $NVM_OS" elif [ "_$NVM_OS" = "_sunos" ]; then