format.sh: support macports clang-format

macports names it clang-format-mp-N to avoid clashing with a
system-installed one.
This commit is contained in:
Jason Rhinelander 2021-08-25 20:54:08 -03:00 committed by Jeff Becker
parent 2964051f0d
commit e39c473c88
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
1 changed files with 3 additions and 0 deletions

View File

@ -3,6 +3,9 @@
CLANG_FORMAT_DESIRED_VERSION=11
binary=$(which clang-format-$CLANG_FORMAT_DESIRED_VERSION 2>/dev/null)
if [ $? -ne 0 ]; then
binary=$(which clang-format-mp-$CLANG_FORMAT_DESIRED_VERSION 2>/dev/null)
fi
if [ $? -ne 0 ]; then
binary=$(which clang-format 2>/dev/null)
if [ $? -ne 0 ]; then