diff --git a/README.md b/README.md index d5706cf..b200ee7 100644 --- a/README.md +++ b/README.md @@ -102,4 +102,4 @@ Bashbot is not more (in)secure as any other Bot written in any other language, w If you feel that there's something missing or if you found a bug, feel free to submit a pull request! -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 diff --git a/README.txt b/README.txt index 38d6a2d..be85344 100644 --- a/README.txt +++ b/README.txt @@ -166,5 +166,5 @@ That's it! If you feel that there's something missing or if you found a bug, feel free to submit a pull request! -latexmath:[\[VERSION\]] 0.70-dev-16-g2eac362 +latexmath:[\[VERSION\]] 0.70-dev-18-g7512681 ++++++++++++++++++++++++++++++++++++++++++++ diff --git a/bashbot.rc b/bashbot.rc index b1abc0e..0126cfb 100755 --- a/bashbot.rc +++ b/bashbot.rc @@ -1,7 +1,7 @@ #!/bin/sh # description: Start or stop telegram-bash-bot # -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 # shellcheck disable=SC2009 # shellcheck disable=SC2181 diff --git a/bashbot.sh b/bashbot.sh index a21c1d1..fe607b3 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -10,7 +10,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 # # Exit Codes: # - 0 sucess (hopefully) diff --git a/commands.sh b/commands.sh index 0802547..c4ff305 100755 --- a/commands.sh +++ b/commands.sh @@ -4,7 +4,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 # # shellcheck disable=SC2154 # shellcheck disable=SC2034 diff --git a/dev/hooks/pre-commit.sh b/dev/hooks/pre-commit.sh index c843364..5072df9 100755 --- a/dev/hooks/pre-commit.sh +++ b/dev/hooks/pre-commit.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script diff --git a/dev/hooks/pre-push.sh b/dev/hooks/pre-push.sh index 4fc338f..57b7d89 100755 --- a/dev/hooks/pre-push.sh +++ b/dev/hooks/pre-push.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script diff --git a/dev/install-hooks.sh b/dev/install-hooks.sh index 2e3b73d..e841136 100755 --- a/dev/install-hooks.sh +++ b/dev/install-hooks.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # this has to run once atfer git clone # and every time we create new hooks -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script diff --git a/dev/shellcheck.files b/dev/shellcheck.files index 5198560..334f203 100644 --- a/dev/shellcheck.files +++ b/dev/shellcheck.files @@ -1,3 +1,3 @@ # list of additional files to check from shellcheck -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 bashbot.rc diff --git a/dev/version.sh b/dev/version.sh index b447894..3f40703 100755 --- a/dev/version.sh +++ b/dev/version.sh @@ -1,6 +1,6 @@ #!/bin/bash # -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 # shellcheck disable=SC2016 # # Easy Versioning in git: diff --git a/doc/1_firstbot.md b/doc/1_firstbot.md index d7efa22..2163d1f 100644 --- a/doc/1_firstbot.md +++ b/doc/1_firstbot.md @@ -61,5 +61,5 @@ group. This step is up to you actually. #### [Next Getting started](2_usage.md) -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 diff --git a/doc/2_usage.md b/doc/2_usage.md index 7ba298c..6f62d64 100644 --- a/doc/2_usage.md +++ b/doc/2_usage.md @@ -159,5 +159,5 @@ send_action "${CHAT[ID]}" "action" #### [Prev Create Bot](1_firstbot.md) #### [Next Advanced Usage](3_advanced.md) -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 diff --git a/doc/3_advanced.md b/doc/3_advanced.md index e43b0e3..13d3770 100644 --- a/doc/3_advanced.md +++ b/doc/3_advanced.md @@ -156,5 +156,5 @@ answer_inline_query "$iQUERY_ID" "cached_sticker" "identifier for the sticker" #### [Prev Advanced Usage](3_advanced.md) #### [Next Expert Use](4_expert.md) -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 diff --git a/doc/4_expert.md b/doc/4_expert.md index b917540..0d0ec65 100644 --- a/doc/4_expert.md +++ b/doc/4_expert.md @@ -104,5 +104,5 @@ An example crontab is provided in ```examples/bashbot.cron```. #### [Prev Expert Use](4_expert.md) #### [Next Best Practice](5_practice.md) -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 diff --git a/doc/5_practice.md b/doc/5_practice.md index 065c894..531777e 100644 --- a/doc/5_practice.md +++ b/doc/5_practice.md @@ -112,5 +112,5 @@ The second warning is about an unused variable, this is true because in our exam #### [Prev Best Practice](5_practice.md) #### [Next Functions Reference](6_reference.md) -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 diff --git a/doc/6_reference.md b/doc/6_reference.md index 11b7883..2925edb 100644 --- a/doc/6_reference.md +++ b/doc/6_reference.md @@ -348,5 +348,5 @@ Send Input from Telegram to waiting Interactive Chat. #### [Prev Best Practice](5_practice.md) #### [Next Developer Rules](7_develop.md) -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 diff --git a/doc/7_develop.md b/doc/7_develop.md index 41cff09..0a2000e 100644 --- a/doc/7_develop.md +++ b/doc/7_develop.md @@ -63,5 +63,5 @@ fi #### [Prev Function Reference](6_function.md) -#### $$VERSION$$ 0.70-dev-17-gb1aef7d +#### $$VERSION$$ 0.70-dev-18-g7512681 diff --git a/examples/bashbot.cron b/examples/bashbot.cron index 1f47f3a..b23505b 100644 --- a/examples/bashbot.cron +++ b/examples/bashbot.cron @@ -7,7 +7,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 SHELL=/bin/sh diff --git a/examples/calc.sh b/examples/calc.sh index 38e2761..400e805 100755 --- a/examples/calc.sh +++ b/examples/calc.sh @@ -3,7 +3,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 # adjust your language setting here # https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment diff --git a/examples/notify.sh b/examples/notify.sh index cdf6210..2a3b859 100755 --- a/examples/notify.sh +++ b/examples/notify.sh @@ -2,7 +2,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 # adjust your language setting here # https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment diff --git a/examples/question,sh b/examples/question,sh index 29aac83..2f9ac95 100755 --- a/examples/question,sh +++ b/examples/question,sh @@ -3,7 +3,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 # adjust your language setting here # https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment diff --git a/examples/question.sh b/examples/question.sh index 29aac83..2f9ac95 100755 --- a/examples/question.sh +++ b/examples/question.sh @@ -3,7 +3,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) -#### $$VERSION$$ 0.70-dev-16-g2eac362 +#### $$VERSION$$ 0.70-dev-18-g7512681 # adjust your language setting here # https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment diff --git a/test/ALL-tests.sh b/test/ALL-tests.sh index 7919984..ff540e0 100755 --- a/test/ALL-tests.sh +++ b/test/ALL-tests.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # this has to run once atfer git clone # and every time we create new hooks -#### $$VERSION$$ 0.70-dev-17-gb1aef7d +#### $$VERSION$$ 0.70-dev-18-g7512681 # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script @@ -11,8 +11,7 @@ cd "${GIT_DIR}/.." || exit 1 # create test environment TESTENV="/tmp/bashbot.test$$" cp -r . "${TESTENV}" - -#cd "${TESTENV}" || exit 1 +cd "test" || exit 1 #set -e fail=0 @@ -20,7 +19,7 @@ tests=0 passed=0 #all_tests=${__dirname:} #echo PLAN ${#all_tests} -for test in $(find test/*-test.sh | sort -u) ; +for test in $(find ./*-test.sh | sort -u) ; do [ "${test}" = "test/all-tests.sh" ] && continue [ ! -x "${test}" ] && continue diff --git a/test/a-commit-test.sh b/test/a-commit-test.sh index 67d6254..7c4182f 100755 --- a/test/a-commit-test.sh +++ b/test/a-commit-test.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.70-dev-17-gb1aef7d +#### $$VERSION$$ 0.70-dev-18-g7512681 -dev/hooks/pre-commit.sh +../dev/hooks/pre-commit.sh diff --git a/test/a-push-test.sh b/test/a-push-test.sh index 40fe041..8505afa 100755 --- a/test/a-push-test.sh +++ b/test/a-push-test.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.70-dev-17-gb1aef7d +#### $$VERSION$$ 0.70-dev-18-g7512681 -dev/hooks/pre-push.sh +../dev/hooks/pre-push.sh diff --git a/test/c-init-test.sh b/test/c-init-test.sh index 4467ce8..3933216 100755 --- a/test/c-init-test.sh +++ b/test/c-init-test.sh @@ -1,10 +1,16 @@ #!/usr/bin/env bash -#### $$VERSION$$ 0.70-dev-17-gb1aef7d +#### $$VERSION$$ 0.70-dev-18-g7512681 -TOKENFILE="./token" -TESTTOKEN="bashbottestscript" TESTME="$(basename "$0")" -NEWFILES="${TOKENFILE} botacl count botadmin JSON.sh/JSON.sh tmp-bot-bash" +DIRME="$(pwd)" +TESTDIR="$1" + +LOGFILE="${TESTDIR}/${TESTME}.log" +REFDIR="${TESTME%.sh}" + +TOKENFILE="token" +TESTTOKEN="bashbottestscript" +TESTFILES="${TOKENFILE} botacl count botadmin" set -e @@ -12,40 +18,39 @@ set -e echo "Running bashbot init" echo "............................" # change to test env -[ "$1" = "" ] && echo "not called from testsuite, exit" && exit -cd "$1" || exit 1 +[ "${TESTDIR}" = "" ] && echo "not called from testsuite, exit" && exit unset IFS; set -f # run bashbot first time with init export TERM="" -"${1}/bashbot.sh" init >"${TESTME}.log" <"${LOGFILE}" </dev/null + ls -d "${TESTDIR}/${file}" >>"${LOGFILE}" + diff -q "${TESTDIR}/${file}" "${REFDIR}/${file}" >>"${LOGFILE}" + done echo "OK" -echo "Check value of token ..." -if [ "${TESTTOKEN}" = "$(cat "${TOKENFILE}")" ]; then - echo "OK" -else - echo "Token not correct or not written!" - exit 1 -fi - echo "Test Sourcing of bashbot.sh ..." trap exit 1 EXIT +cd "${TESTDIR}" || exit # shellcheck source=./bashbot.sh -source "$1/bashbot.sh" source +source "${TESTDIR}/bashbot.sh" source trap '' EXIT +cd "${DIRME}" || exit 1 + +echo "Test bashbot.sh count" +cp "${REFDIR}/count.test" "${TESTDIR}/count" +"${TESTDIR}/bashbot.sh" count