blob: 3d0cfcc93c7e0d202645b507a7a4b8eda5ba6b39 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#!/usr/bin/env bash
# OS X names clang-format as clang-format; Ubuntu uses
# clang-format-version so check for the right one
if which "clang-format-3.6" > /dev/null 2>&1 ; then
export CF="$(which clang-format-3.6)"
elif which "clang-format" > /dev/null 2>&1 ; then
export CF="$(which clang-format)"
else
echo "Unable to find clang-format"
exit 1
fi
cd $(dirname "$0")
for D in */; do
for file in "${D}"*.cpp; do
if [ -e $file ] ; then
$CF -style=file -i "$file"
fi
done
for file in "${D}"*.h ; do
if [ -e $file ] ; then
$CF -style=file -i "$file"
fi
done
for file in "${D}"*.hpp ; do
if [ -e $file ] ; then
$CF -style=file -i "$file"
fi
done
for file in "${D}"*.in ; do
if [ -e $file ] ; then
$CF -style=file -i "$file"
fi
done
done
|