From b59af40e91d4ffcaa01eddfc775272ac477d1633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Baldassari?= Date: Thu, 17 Mar 2016 17:20:58 -0700 Subject: [PATCH] Fix precommit scripts on OSX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JerryScript-DCO-1.0-Signed-off-by: François Baldassari francois@pebble.com --- tools/check-cppcheck.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/check-cppcheck.sh b/tools/check-cppcheck.sh index 98e118a848..422e0c4029 100755 --- a/tools/check-cppcheck.sh +++ b/tools/check-cppcheck.sh @@ -15,7 +15,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -CPPCHECK_JOBS=${CPPCHECK_JOBS:=$(nproc)} +if [[ "$OSTYPE" == "linux"* ]]; then + CPPCHECK_JOBS=${CPPCHECK_JOBS:=$(nproc)} +elif [[ "$OSTYPE" == "darwin"* ]]; then + CPPCHECK_JOBS=${CPPCHECK_JOBS:=$(sysctl -n hw.ncpu)} +else + CPPCHECK_JOBS=${CPPCHECK_JOBS:=1} +fi JERRY_CORE_DIRS=`find jerry-core -type d` JERRY_LIBC_DIRS=`find jerry-libc -type d`