Skip to content
Myr

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

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fixes #1115.

authored by Jordan Harband · committed by Jordan Harband · parent b648158 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:nvm.sh+1 added-1 removed
1421 unmodified lines
1422 local NVM_OS1423 NVM_OS="$(nvm_get_os)"1424 local NVM_CPU_THREADS1425 if [ "_$NVM_OS" = "_linux" ]; then1426 NVM_CPU_THREADS="$(grep -c 'core id' /proc/cpuinfo)"1426 NVM_CPU_THREADS="$(command grep -c -E '^processor.+: [0-9]+' /proc/cpuinfo)"1427 elif [ "_$NVM_OS" = "_freebsd" ] || [ "_$NVM_OS" = "_darwin" ]; then1428 NVM_CPU_THREADS="$(sysctl -n hw.ncpu)"1429 elif [ "_$NVM_OS" = "_sunos" ]; then1430 NVM_CPU_THREADS="$(psrinfo | wc -l)"
1191 unmodified lines