File tree Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Expand file tree Collapse file tree 1 file changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -13,24 +13,23 @@ if test x"$1" = xchanged; then
13
13
fi
14
14
15
15
# Find clang-format, we prefer -6.0, but also allow binaries without -suffix as
16
- # long as they're 6.0.0
17
- CLANG_FORMAT=
16
+ # long as they're >= 6.0.0
17
+ CLANG_FORMAT=` which clang-format-6.0 `
18
18
19
- which clang-format-6.0
20
- if [ $? = 0 ]; then
21
- CLANG_FORMAT=` which clang-format-6.0`
19
+ if [ -z " $CLANG_FORMAT " ]; then
20
+ CLANG_FORMAT=` which clang-format`
22
21
fi
23
22
24
- which clang-format
25
- if [ $? = 0 ]; then
26
- VERSION=` clang-format -version | cut -d " " -f 3 | cut -c 1-3`
27
- if [ x" $VERSION " = " x6.0" ]; then
28
- CLANG_FORMAT=` which clang-format`
29
- fi
23
+ if [ -z " $CLANG_FORMAT " ]; then
24
+ echo " Couldn't find clang-format"
25
+ exit
30
26
fi
31
27
32
- if [ x" $CLANG_FORMAT " = " x" ]; then
33
- echo " Couldn't find the right clang-format (needs version 6.0)"
28
+ VERSION=` $CLANG_FORMAT -version | cut -d " " -f 3`
29
+ VERSION_MAJOR=` echo $VERSION | cut -d " ." -f 1`
30
+
31
+ if [ $VERSION_MAJOR -lt 6 ]; then
32
+ echo " Found clang-format $VERSION but we need >= 6.0.0"
34
33
exit
35
34
fi
36
35
You can’t perform that action at this time.
0 commit comments