Skip to content

Commit 0d8303e

Browse files
committed
Improved clang-format version extraction in reformat script
1 parent 041ec7c commit 0d8303e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tools/reformat-source.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22

3-
VERSION=`clang-format --version | grep -o '[^ ]*$' | cut -d '.' -f 1`
3+
VERSION=`clang-format --version | grep -Po '(?<=\s)\d+(?=\.\d+\.\d+\s)'`
4+
45
if [ "$VERSION" -ge "14" ]; then
56
CLANG_FORMAT=clang-format
67
elif clang-format-14 --version > /dev/null; then

0 commit comments

Comments
 (0)