浏览代码

Merge pull request #2577 from yalpul/patch-1

CI: Make processor count consistent
Colin Edwards 5 年之前
父节点
当前提交
3b27eee20f
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      formatcode.sh

+ 2 - 4
formatcode.sh

@@ -14,10 +14,8 @@ set -o nounset
 # Get CPU count
 OS=$(uname)
 NPROC=1
-if [[ $OS = "Linux" ]] ; then
-    NPROC=$(nproc)
-elif [[ ${OS} = "Darwin" ]] ; then
-    NPROC=$(sysctl -n hw.physicalcpu)
+if [[ $OS = "Linux" || $OS = "Darwin" ]] ; then
+    NPROC=$(getconf _NPROCESSORS_ONLN)
 fi
 
 # Discover clang-format