[Fix] `nvm install -s`: when “core id” doesn’t appear in /proc/cpuinfo, fall back to counting “processor” lines.

Fixes #1115.
Jordan Harband 2016-06-13 08:41:17 -07:00
parent b6481583af
commit 45ae48df2d
No known key found for this signature in database
GPG Key ID: 64A196AEE0916D55
1 changed files with 1 additions and 1 deletions

2
nvm.sh
View File

@ -1423,7 +1423,7 @@ nvm_get_make_jobs() {
NVM_OS="$(nvm_get_os)"
local NVM_CPU_THREADS
if [ "_$NVM_OS" = "_linux" ]; then
NVM_CPU_THREADS="$(grep -c 'core id' /proc/cpuinfo)"
NVM_CPU_THREADS="$(command grep -c -E '^processor.+: [0-9]+' /proc/cpuinfo)"
elif [ "_$NVM_OS" = "_freebsd" ] || [ "_$NVM_OS" = "_darwin" ]; then
NVM_CPU_THREADS="$(sysctl -n hw.ncpu)"
elif [ "_$NVM_OS" = "_sunos" ]; then