summaryrefslogtreecommitdiff
path: root/other/astyle/format-source
diff options
context:
space:
mode:
Diffstat (limited to 'other/astyle/format-source')
-rwxr-xr-xother/astyle/format-source7
1 files changed, 5 insertions, 2 deletions
diff --git a/other/astyle/format-source b/other/astyle/format-source
index 7fa8b677..711823d8 100755
--- a/other/astyle/format-source
+++ b/other/astyle/format-source
@@ -35,10 +35,10 @@ FROM_JSON='s/\\"/"/g;s/^"(.*)"$/$1/;s/\\\\/\\/g;s/\\n/\n/g'
35 35
36apidsl_request() { 36apidsl_request() {
37 TMPFILE=$(mktemp /tmp/apidsl.XXXXXX) 37 TMPFILE=$(mktemp /tmp/apidsl.XXXXXX)
38 curl -o "$TMPFILE" -X POST --data @<( 38 curl -s -o "$TMPFILE" -X POST --data @<(
39 echo '["Request",'; 39 echo '["Request",';
40 cat $2; 40 cat $2;
41 echo ']') https://apidsl2.herokuapp.com/$1 41 echo ']') https://apidsl.herokuapp.com/$1
42 if grep '\[1,"' "$TMPFILE" > /dev/null; then 42 if grep '\[1,"' "$TMPFILE" > /dev/null; then
43 echo "Error: $(grep -o '".*"' /tmp/apidsl-$$ | perl -0777 -pe "$FROM_JSON")" >&2 43 echo "Error: $(grep -o '".*"' /tmp/apidsl-$$ | perl -0777 -pe "$FROM_JSON")" >&2
44 rm "$TMPFILE" 44 rm "$TMPFILE"
@@ -49,12 +49,14 @@ apidsl_request() {
49} 49}
50 50
51apidsl_curl() { 51apidsl_curl() {
52 echo "apidsl_curl $@" >&2
52 apidsl_request "c" <( 53 apidsl_request "c" <(
53 apidsl_request "parse" <( 54 apidsl_request "parse" <(
54 perl -0777 -pe "$TO_JSON" $1)) | perl -0777 -pe "$FROM_JSON" 55 perl -0777 -pe "$TO_JSON" $1)) | perl -0777 -pe "$FROM_JSON"
55} 56}
56 57
57# Check if apidsl generated sources are up to date. 58# Check if apidsl generated sources are up to date.
59set +x
58$APIDSL toxcore/LAN_discovery.api.h > toxcore/LAN_discovery.h & 60$APIDSL toxcore/LAN_discovery.api.h > toxcore/LAN_discovery.h &
59$APIDSL toxcore/crypto_core.api.h > toxcore/crypto_core.h & 61$APIDSL toxcore/crypto_core.api.h > toxcore/crypto_core.h &
60$APIDSL toxcore/ping.api.h > toxcore/ping.h & 62$APIDSL toxcore/ping.api.h > toxcore/ping.h &
@@ -62,6 +64,7 @@ $APIDSL toxcore/ping_array.api.h > toxcore/ping_array.h &
62$APIDSL toxcore/tox.api.h > toxcore/tox.h & 64$APIDSL toxcore/tox.api.h > toxcore/tox.h &
63$APIDSL toxav/toxav.api.h > toxav/toxav.h & 65$APIDSL toxav/toxav.api.h > toxav/toxav.h &
64$APIDSL toxencryptsave/toxencryptsave.api.h > toxencryptsave/toxencryptsave.h & 66$APIDSL toxencryptsave/toxencryptsave.api.h > toxencryptsave/toxencryptsave.h &
67set -x
65 68
66wait; wait; wait; wait; wait; wait; wait 69wait; wait; wait; wait; wait; wait; wait
67 70