easy-builder: get number of cpus on macOS a better way
authorThomas Debesse <dev@illwieckz.net>
Fri, 19 Feb 2021 10:26:31 +0000 (11:26 +0100)
committerThomas Debesse <dev@illwieckz.net>
Sat, 20 Feb 2021 17:06:44 +0000 (18:06 +0100)
easy-builder

index 845d2c7ca2e29f5a1e28fcf185fc6a5c923d4c8e..4dbb393f2670bcfe3d214ff930717e11f0f7a512 100755 (executable)
@@ -25,9 +25,13 @@ _nproc () {
                        'Linux')
                                egrep "^processor" /proc/cpuinfo | wc -l
                                ;;
-                       'FreeBSD'|'Darwin')
+                       'FreeBSD')
                                sysctl -n hw.ncpu
                                ;;
+                       'Darwin')
+                               sysctl -n hw.logicalcpu \
+                               || sysctl -n hw.ncpu
+                               ;;
                        'MSYS_NT-'*|'CYGWIN_NT-'*|'MINGW'*'_NT-'*)
                                if command -v 'wmic' >/dev/null
                                then