summaryrefslogtreecommitdiffstats
path: root/polly/utils/update_format.sh
diff options
context:
space:
mode:
Diffstat (limited to 'polly/utils/update_format.sh')
-rwxr-xr-xpolly/utils/update_format.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/polly/utils/update_format.sh b/polly/utils/update_format.sh
index 8fee5cc330b..9226fc6af52 100755
--- a/polly/utils/update_format.sh
+++ b/polly/utils/update_format.sh
@@ -1,11 +1,16 @@
#!/bin/bash
-if ! which clang-format; then
- echo "Error: cannot find clang-format in your path"
- exit 1
+CLANG_FORMAT=${CLANG_FORMAT}
+
+if [ "${CLANG_FORMAT}x" = "x" ]; then
+ CLANG_FORMAT=`which clang-format`
+ if [ "${CLANG_FORMAT}x" = "x" ]; then
+ echo "Error: cannot find clang-format in your path"
+ exit 1
+ fi
fi
for ARG in "$@"
do
- clang-format -i $ARG
+ ${CLANG_FORMAT} -i $ARG
done
OpenPOWER on IntegriCloud