Skip to content

Fix precommit scripts on OSX #970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tools/check-cppcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting this work on OSX! This script becomes just a little bit incomplete, however. Please, add a final else branch that sets CPPCHECK_JOBS to something basic default, just to make sure that the script doesn't break. (E.g., if someone builds on freebsd, or whatever.) I'd go for a default of 1.

else
CPPCHECK_JOBS=${CPPCHECK_JOBS:=1}
fi

JERRY_CORE_DIRS=`find jerry-core -type d`
JERRY_LIBC_DIRS=`find jerry-libc -type d`
Expand Down