summaryrefslogtreecommitdiff
path: root/scripts/clang-tools.sh
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-07-21 13:07:03 +0300
committerKonstantin Käfer <mail@kkaefer.com>2016-08-05 11:42:22 +0200
commit023ff83d881fb810f4428594ca476bb436b303f6 (patch)
treecd2895189ebad59aba9bc471ac2e032967f9a0ca /scripts/clang-tools.sh
parentc6313681d2c54bd4f333688f141a8062bce5a30d (diff)
downloadqtlocation-mapboxgl-023ff83d881fb810f4428594ca476bb436b303f6.tar.gz
[build] Fix 'make tidy' on linux
Diffstat (limited to 'scripts/clang-tools.sh')
-rwxr-xr-xscripts/clang-tools.sh15
1 files changed, 7 insertions, 8 deletions
diff --git a/scripts/clang-tools.sh b/scripts/clang-tools.sh
index 6a10740c77..fa9825f4a4 100755
--- a/scripts/clang-tools.sh
+++ b/scripts/clang-tools.sh
@@ -42,15 +42,14 @@ function check_format() {
export CLANG_TIDY CLANG_FORMAT
export -f check_tidy check_format
-git diff-index --quiet HEAD || {
- echo "Your repository contains unstaged and/or uncommitted changes."
- echo "Please commit all changes before proceeding."
- exit 1
-}
-
echo "Running clang checks... (this might take a while)"
-if [ -n $2 ] && [ $2 == "--diff" ]; then
+if [[ -n $2 ]] && [[ $2 == "--diff" ]]; then
+ git diff-index --quiet HEAD || {
+ echo "Your repository contains unstaged and/or uncommitted changes."
+ echo "Please commit all changes before proceeding."
+ exit 1
+ }
DIFF_FILES=$(for file in `git diff origin/master..HEAD --name-only | grep "pp$"`; do echo $file; done)
if [[ -n $DIFF_FILES ]]; then
echo "${DIFF_FILES}" | xargs -I{} -P ${JOBS} bash -c 'check_tidy --fix' {}
@@ -63,6 +62,6 @@ if [ -n $2 ] && [ $2 == "--diff" ]; then
fi
echo "All looks good!"
else
- git ls-files '${CDUP}/src/mbgl/*.cpp' '${CDUP}/platform/*.cpp' '${CDUP}/test/*.cpp' | \
+ git ls-files "${CDUP}/src/mbgl/*.cpp" "${CDUP}/platform/*.cpp" "${CDUP}/test/*.cpp" | \
xargs -I{} -P ${JOBS} bash -c 'check_tidy' {}
fi