Skip to content

Commit

Permalink
fix(scripts): support mac version of nproc
Browse files Browse the repository at this point in the history
  • Loading branch information
aaraney authored and robertbartel committed May 20, 2024
1 parent 417ea09 commit eb2b3c9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/create_env_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ fi

# TODO: provide args to optionally parameterize JOBS_CPU_COUNT (while still sanity checking against nproc)
if [ -z "${JOBS_CPU_COUNT:-}" ]; then
_TOTAL_CPU=$(nproc)
# `nproc` is not natively supported on mac
if [ $(uname -s) = 'Darwin' ]; then
_TOTAL_CPU=$(sysctl -n hw.ncpu)
else
_TOTAL_CPU=$(nproc)
fi
if [ ${_TOTAL_CPU} -lt 2 ]; then
JOBS_CPU_COUNT=1
elif [ ${_TOTAL_CPU} -lt 8 ]; then
Expand Down

0 comments on commit eb2b3c9

Please sign in to comment.