diff options
author | Oleg Morozenkov <m@oleg.rocks> | 2018-07-23 01:56:42 +0300 |
---|---|---|
committer | Oleg Morozenkov <m@oleg.rocks> | 2018-07-23 01:56:42 +0300 |
commit | d47ee877be5d1175bdc36f2d87881ddaf875a8e9 (patch) | |
tree | 7fd20cdc1236fe6b832ae980de12afd7071ebab9 /tools | |
parent | cea20d4078f2088dea0dd589f1cc9dd7ee22461b (diff) |
Refactor http clients, fix webhook server, add more samples, change tabs to 4 spaces
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/docker-run-sample | 6 | ||||
-rwxr-xr-x | tools/docker-run-sample-webhook | 6 | ||||
-rwxr-xr-x | tools/docker-test | 6 | ||||
-rwxr-xr-x | tools/generate-docs | 7 | ||||
-rwxr-xr-x | tools/list-includes | 19 | ||||
-rwxr-xr-x | tools/list-srcs | 4 |
6 files changed, 48 insertions, 0 deletions
diff --git a/tools/docker-run-sample b/tools/docker-run-sample new file mode 100755 index 0000000..e7ac6ba --- /dev/null +++ b/tools/docker-run-sample @@ -0,0 +1,6 @@ +#!/bin/bash +set -e + +cd .. +docker build -t reo7sp/tgbot-cpp -f Dockerfile_test . +docker run --rm -it -e TOKEN=$2 reo7sp/tgbot-cpp /usr/src/tgbot-cpp/samples/$1/$1 diff --git a/tools/docker-run-sample-webhook b/tools/docker-run-sample-webhook new file mode 100755 index 0000000..386b0c6 --- /dev/null +++ b/tools/docker-run-sample-webhook @@ -0,0 +1,6 @@ +#!/bin/bash +set -e + +cd .. +docker build -t reo7sp/tgbot-cpp -f Dockerfile_test . +docker run --rm -it -e TOKEN=$2 -e WEBHOOK_URL=$3 -p $4:8080 reo7sp/tgbot-cpp /usr/src/tgbot-cpp/samples/$1/$1 diff --git a/tools/docker-test b/tools/docker-test new file mode 100755 index 0000000..5451ff1 --- /dev/null +++ b/tools/docker-test @@ -0,0 +1,6 @@ +#!/bin/bash +set -e + +cd .. +docker build -t reo7sp/tgbot-cpp -f Dockerfile_test . +docker run --rm -it reo7sp/tgbot-cpp
\ No newline at end of file diff --git a/tools/generate-docs b/tools/generate-docs new file mode 100755 index 0000000..0caab1d --- /dev/null +++ b/tools/generate-docs @@ -0,0 +1,7 @@ +#!/bin/bash + +cd .. +rm -rf doc docs +doxygen +mv doc/html docs +touch docs/.nojekyll diff --git a/tools/list-includes b/tools/list-includes new file mode 100755 index 0000000..5e04c1a --- /dev/null +++ b/tools/list-includes @@ -0,0 +1,19 @@ +#!/bin/bash + +if uname -a | grep Darwin > /dev/null; then + is_macos=1 +else + is_macos=0 +fi +if [[ $is_macos == 1 ]]; then + this_sed() { + gsed "$@" + } +else + this_sed() { + sed "$@" + } +fi + +cd ../include +tree -a -f --noreport -i | grep '\.h' | this_sed -r 's!^\./(.+?)$!#include "\1"!' diff --git a/tools/list-srcs b/tools/list-srcs new file mode 100755 index 0000000..ed2a199 --- /dev/null +++ b/tools/list-srcs @@ -0,0 +1,4 @@ +#!/bin/bash + +cd .. +tree src -a -f --noreport -i | grep '\.cpp' |