Skip to content

Commit 2f2d419

Browse files
committed
Prefer clang-format-8
1 parent 6df0d31 commit 2f2d419

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

commands/format

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,16 @@ fi
1818
NO_RUN_IF_EMPTY=()
1919
if [[ "$OSTYPE" != "darwin"* ]]; then NO_RUN_IF_EMPTY+=(--no-run-if-empty); fi
2020

21+
if command -v clang-format-8 > /dev/null ; then
22+
CLANG_FORMAT=clang-format-8
23+
else
24+
CLANG_FORMAT=clang-format
25+
fi
26+
2127
for ROOT in provides internals ; do
2228
find $ROOT -name '*.md' -print0 | xargs "${NO_RUN_IF_EMPTY[@]}" -0 prettier --write --
2329
for SUFFIX in cpp hpp ; do
24-
find $ROOT -name "*.$SUFFIX" -print0 | xargs "${NO_RUN_IF_EMPTY[@]}" -0 clang-format -i --
30+
find $ROOT -name "*.$SUFFIX" -print0 | xargs "${NO_RUN_IF_EMPTY[@]}" -0 $CLANG_FORMAT -i --
2531
done
2632
done
2733

0 commit comments

Comments
 (0)