summaryrefslogtreecommitdiff
path: root/other/astyle/format-source
diff options
context:
space:
mode:
Diffstat (limited to 'other/astyle/format-source')
-rwxr-xr-xother/astyle/format-source26
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
3set -e
4
5SOURCE_DIR="$1"
6
7# Go to the source root.
8if [ -z "$SOURCE_DIR" ]; then
9 SOURCE_DIR=.
10fi
11cd "$SOURCE_DIR"
12
3if [ -z "$ASTYLE" ]; then 13if [ -z "$ASTYLE" ]; then
4 ASTYLE=astyle 14 ASTYLE=astyle
5fi 15fi
6 16
17if [ -f ../apidsl/_build/apigen.native ]; then
18 APIDSL=../apidsl/_build/apigen.native
19else
20 APIDSL=apidsl_curl
21fi
22
23apidsl_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
7SOURCES=`find . -name "*.[ch]" -and -not -name "*.in.*" -and -not -wholename "*crypto_pwhash*" -and -not -wholename "./super_donators/*"` 31SOURCES=`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
35git diff --exit-code