From d47ee877be5d1175bdc36f2d87881ddaf875a8e9 Mon Sep 17 00:00:00 2001 From: Oleg Morozenkov Date: Mon, 23 Jul 2018 01:56:42 +0300 Subject: Refactor http clients, fix webhook server, add more samples, change tabs to 4 spaces --- tools/docker-run-sample | 6 ++++++ tools/docker-run-sample-webhook | 6 ++++++ tools/docker-test | 6 ++++++ tools/generate-docs | 7 +++++++ tools/list-includes | 19 +++++++++++++++++++ tools/list-srcs | 4 ++++ 6 files changed, 48 insertions(+) create mode 100755 tools/docker-run-sample create mode 100755 tools/docker-run-sample-webhook create mode 100755 tools/docker-test create mode 100755 tools/generate-docs create mode 100755 tools/list-includes create mode 100755 tools/list-srcs (limited to 'tools') 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' -- cgit v1.2.3 From f13b7029e9af43282ebe6c2e9bb4dd749c8e450a Mon Sep 17 00:00:00 2001 From: Oleg Morozenkov Date: Mon, 23 Jul 2018 02:09:18 +0300 Subject: Move docs to gh-pages branch --- tools/push-ghpages | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tools/push-ghpages (limited to 'tools') diff --git a/tools/push-ghpages b/tools/push-ghpages new file mode 100644 index 0000000..91f606a --- /dev/null +++ b/tools/push-ghpages @@ -0,0 +1,12 @@ +#!/bin/bash +set -e -o pipefail + +./generate-docs +git checkout gh-pages +find . -maxdepth 1 -not -name "docs" -not -name ".git" -print0 | xargs -0 rm -r +mv docs/* . +mv docs/.nojekyll . +rmdir docs +git add -A +git commit -m "Updated docs $(date)" +git push origin gh-pages -- cgit v1.2.3 From 167e3e7607e43a0f06c7f87ced94f481e6525b0e Mon Sep 17 00:00:00 2001 From: Oleg Morozenkov Date: Mon, 23 Jul 2018 02:15:02 +0300 Subject: Fix docs --- tools/push-ghpages | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) mode change 100644 => 100755 tools/push-ghpages (limited to 'tools') diff --git a/tools/push-ghpages b/tools/push-ghpages old mode 100644 new mode 100755 index 91f606a..e7b41fa --- a/tools/push-ghpages +++ b/tools/push-ghpages @@ -1,12 +1,14 @@ #!/bin/bash -set -e -o pipefail ./generate-docs +cd .. git checkout gh-pages -find . -maxdepth 1 -not -name "docs" -not -name ".git" -print0 | xargs -0 rm -r +find . -maxdepth 1 -not -name "docs" -not -name ".git" -not -name "tools" -print0 | xargs -0 rm -r mv docs/* . mv docs/.nojekyll . rmdir docs +rm -r tools/* git add -A git commit -m "Updated docs $(date)" git push origin gh-pages +git checkout master -- cgit v1.2.3