diff options
Diffstat (limited to 'other/astyle/format-source')
-rwxr-xr-x | other/astyle/format-source | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/other/astyle/format-source b/other/astyle/format-source index 9571fd7b..fc81f744 100755 --- a/other/astyle/format-source +++ b/other/astyle/format-source | |||
@@ -1,9 +1,35 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | set -e | ||
4 | |||
5 | SOURCE_DIR="$1" | ||
6 | |||
7 | # Go to the source root. | ||
8 | if [ -z "$SOURCE_DIR" ]; then | ||
9 | SOURCE_DIR=. | ||
10 | fi | ||
11 | cd "$SOURCE_DIR" | ||
12 | |||
3 | if [ -z "$ASTYLE" ]; then | 13 | if [ -z "$ASTYLE" ]; then |
4 | ASTYLE=astyle | 14 | ASTYLE=astyle |
5 | fi | 15 | fi |
6 | 16 | ||
17 | if [ -f ../apidsl/_build/apigen.native ]; then | ||
18 | APIDSL=../apidsl/_build/apigen.native | ||
19 | else | ||
20 | APIDSL=apidsl_curl | ||
21 | fi | ||
22 | |||
23 | apidsl_curl() { | ||
24 | curl -X POST --data-binary @"$1" https://apidsl.herokuapp.com/apidsl | ||
25 | } | ||
26 | |||
27 | # Check if toxcore.h and toxav.h match apidsl tox.in.h and toxav.in.h. | ||
28 | $APIDSL other/apidsl/tox.in.h > toxcore/tox.h | ||
29 | $APIDSL other/apidsl/toxav.in.h > toxav/toxav.h | ||
30 | |||
7 | SOURCES=`find . -name "*.[ch]" -and -not -name "*.in.*" -and -not -wholename "*crypto_pwhash*" -and -not -wholename "./super_donators/*"` | 31 | SOURCES=`find . -name "*.[ch]" -and -not -name "*.in.*" -and -not -wholename "*crypto_pwhash*" -and -not -wholename "./super_donators/*"` |
8 | 32 | ||
9 | $ASTYLE -n --options=other/astyle/astylerc $SOURCES | 33 | $ASTYLE -n --options=other/astyle/astylerc $SOURCES |
34 | |||
35 | git diff --exit-code | ||