minor test

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2019-04-25 14:01:42 +02:00
parent fe4fb34e8a
commit d55d311263
38 changed files with 60 additions and 59 deletions

View File

@ -76,4 +76,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! If you feel that there's something missing or if you found a bug, feel free to submit a pull request!
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34

View File

@ -123,5 +123,5 @@ That's it!
If you feel that there's something missing or if you found a bug, feel If you feel that there's something missing or if you found a bug, feel
free to submit a pull request! free to submit a pull request!
latexmath:[\[VERSION\]] v0.70-dev2-21-g0cfb9f0 latexmath:[\[VERSION\]] v0.70-dev2-24-gfe4fb34
++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++++++

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# description: Start or stop telegram-bash-bot # description: Start or stop telegram-bash-bot
# #
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# shellcheck disable=SC2009 # shellcheck disable=SC2009
# shellcheck disable=SC2181 # shellcheck disable=SC2181

View File

@ -12,7 +12,7 @@
# This file is public domain in the USA and all free countries. # This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
# #
#### $$VERSION$$ v0.70-dev2-23-ga7d14f6 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# #
# Exit Codes: # Exit Codes:
# - 0 sucess (hopefully) # - 0 sucess (hopefully)

View File

@ -5,7 +5,7 @@
# This file is public domain in the USA and all free countries. # This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
# #
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# #
# shellcheck disable=SC2154 # shellcheck disable=SC2154
# shellcheck disable=SC2034 # shellcheck disable=SC2034

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# magic to ensure that we're always inside the root of our application, # magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script # no matter from which directory we'll run script
@ -7,7 +7,7 @@ GIT_DIR=$(git rev-parse --git-dir)
cd "$GIT_DIR/.." || exit 1 cd "$GIT_DIR/.." || exit 1
export HOOKDIR="dev/hooks" export HOOKDIR="dev/hooks"
LASTPUSH='.git/.lastpush'
# if any command inside script returns error, exit and return that error # if any command inside script returns error, exit and return that error
set -e set -e
@ -38,3 +38,24 @@ else
# something went wrong # something went wrong
exit 1 exit 1
fi fi
REMOTEVER="$(git ls-remote -t --refs 2>/dev/null | tail -1 | sed 's/.*\/v//')"
VERSION="$(git describe --tags | sed -e 's/-.*//' -e 's/v//')"
# LOCAL version must greater than latest REMOTE release version
if (( $(echo "${VERSION} > ${REMOTEVER}" | bc -l) )); then
# update version in bashbot files on push
set +f
[ -f "${LASTPUSH}" ] && LASTFILES="$(find ./* -newer "${LASTPUSH}")"
[ "${LASTFILES}" = "" ] && exit
echo -n " "
# shellcheck disable=SC2086
dev/version.sh ${LASTFILES} 2>/dev/null || exit 1
echo " OK"
else
echo "Error: local version ${VERSION} must be greater than latest release version."
echo "use \"git tag ...\" to create a local version greater than ${REMOTEVER}"
exit 1
fi

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
#### $$VERSION$$ v0.70-dev2-23-ga7d14f6 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# magic to ensure that we're always inside the root of our application, # magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script # no matter from which directory we'll run script
@ -7,11 +7,7 @@ GIT_DIR=$(git rev-parse --git-dir)
cd "$GIT_DIR/.." || exit 1 cd "$GIT_DIR/.." || exit 1
export HOOKDIR="dev/hooks" export HOOKDIR="dev/hooks"
LASTPUSH='.git/.lastpush' LASTPUSH='.git/.lastpush'
REMOTEVER="$(git ls-remote -t --refs 2>/dev/null | tail -1 | sed 's/.*\/v//')"
VERSION="$(git describe --tags | sed -e 's/-.*//' -e 's/v//')"
# if any command inside script returns error, exit and return that error # if any command inside script returns error, exit and return that error
set -e set -e
@ -21,21 +17,5 @@ echo "............................"
unset IFS; set -f unset IFS; set -f
# LOCAL version must greater than latest REMOTE release version
if (( $(echo "${VERSION} > ${REMOTEVER}" | bc -l) )); then
# update version in bashbot files on push
set +f
[ -f "${LASTPUSH}" ] && LASTFILES="$(find ./* -newer "${LASTPUSH}")"
[ "${LASTFILES}" = "" ] && exit
echo -n " "
# shellcheck disable=SC2086
dev/version.sh ${LASTFILES} 2>/dev/null || exit 1
echo " OK"
else
echo "Error: local version ${VERSION} must be greater than latest release version."
echo "use \"git tag ...\" to create a local version greater than ${REMOTEVER}"
exit 1
fi
# note date of last push for version # note date of last push for version
touch "${LASTPUSH}" touch "${LASTPUSH}"

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# this has to run once atfer git clone # this has to run once atfer git clone
# and every time we create new hooks # and every time we create new hooks
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# magic to ensure that we're always inside the root of our application, # magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script # no matter from which directory we'll run script

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# this has to run once atfer git clone # this has to run once atfer git clone
# and every time we create new hooks # and every time we create new hooks
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# magic to ensure that we're always inside the root of our application, # magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script # no matter from which directory we'll run script

View File

@ -1,3 +1,3 @@
# list of additional files to check from shellcheck # list of additional files to check from shellcheck
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
bashbot.rc bashbot.rc

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# #
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# shellcheck disable=SC2016 # shellcheck disable=SC2016
# #
# Easy Versioning in git: # Easy Versioning in git:

View File

@ -61,5 +61,5 @@ The old format is supported for backward compatibility, but may fail for corner
#### [Next Create Bot](1_firstbot.md) #### [Next Create Bot](1_firstbot.md)
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34

View File

@ -62,5 +62,5 @@ group. This step is up to you actually.
#### [Prev Installation](0_install.md) #### [Prev Installation](0_install.md)
#### [Next Getting started](2_usage.md) #### [Next Getting started](2_usage.md)
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34

View File

@ -166,5 +166,5 @@ send_action "${CHAT[ID]}" "action"
#### [Prev Create Bot](1_firstbot.md) #### [Prev Create Bot](1_firstbot.md)
#### [Next Advanced Usage](3_advanced.md) #### [Next Advanced Usage](3_advanced.md)
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34

View File

@ -156,5 +156,5 @@ answer_inline_query "$iQUERY_ID" "cached_sticker" "identifier for the sticker"
#### [Prev Advanced Usage](3_advanced.md) #### [Prev Advanced Usage](3_advanced.md)
#### [Next Expert Use](4_expert.md) #### [Next Expert Use](4_expert.md)
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34

View File

@ -104,5 +104,5 @@ An example crontab is provided in ```examples/bashbot.cron```.
#### [Prev Expert Use](4_expert.md) #### [Prev Expert Use](4_expert.md)
#### [Next Best Practice](5_practice.md) #### [Next Best Practice](5_practice.md)
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34

View File

@ -141,5 +141,5 @@ The second warning is about an unused variable, this is true because in our exam
#### [Prev Best Practice](5_practice.md) #### [Prev Best Practice](5_practice.md)
#### [Next Functions Reference](6_reference.md) #### [Next Functions Reference](6_reference.md)
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34

View File

@ -445,5 +445,5 @@ Send Input from Telegram to waiting Interactive Chat.
#### [Prev Best Practice](5_practice.md) #### [Prev Best Practice](5_practice.md)
#### [Next Notes for Developers](7_develop.md) #### [Next Notes for Developers](7_develop.md)
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34

View File

@ -71,5 +71,5 @@ fi
#### [Prev Function Reference](6_function.md) #### [Prev Function Reference](6_function.md)
#### [Next Bashbot Environment](8_custom.md) #### [Next Bashbot Environment](8_custom.md)
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34

View File

@ -131,5 +131,5 @@ for every poll until the maximum of BASHBOT_SLEEP ms.
#### [Prev Notes for Developers](7_develop.md) #### [Prev Notes for Developers](7_develop.md)
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34

View File

@ -7,7 +7,7 @@
# This file is public domain in the USA and all free countries. # This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
# #
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
SHELL=/bin/sh SHELL=/bin/sh

View File

@ -3,7 +3,7 @@
# This file is public domain in the USA and all free countries. # This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# adjust your language setting here # adjust your language setting here
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment # https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment

View File

@ -2,7 +2,7 @@
# This file is public domain in the USA and all free countries. # This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# adjust your language setting here # adjust your language setting here
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment # https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment

View File

@ -3,7 +3,7 @@
# This file is public domain in the USA and all free countries. # This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# adjust your language setting here # adjust your language setting here
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment # https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment

View File

@ -3,7 +3,7 @@
# This file is public domain in the USA and all free countries. # This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# adjust your language setting here # adjust your language setting here
# https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment # https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment

View File

@ -5,7 +5,7 @@
# This file is public domain in the USA and all free countries. # This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
# #
#### $$VERSION$$ v0.70-dev2-23-ga7d14f6 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# #
# source from commands.sh to use the aliases # source from commands.sh to use the aliases

View File

@ -5,7 +5,7 @@
# This file is public domain in the USA and all free countries. # This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
# #
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# source from commands.sh if you want ro use interactive or background jobs # source from commands.sh if you want ro use interactive or background jobs

View File

@ -5,6 +5,6 @@
# This file is public domain in the USA and all free countries. # This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
# #
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# source from commands.sh to use the inline functions # source from commands.sh to use the inline functions

View File

@ -2,7 +2,7 @@
# files: mycommands.sh.dist # files: mycommands.sh.dist
# copy to mycommands.sh and add all your commands and functions here ... # copy to mycommands.sh and add all your commands and functions here ...
# #
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# #
# shellcheck disable=SC2154 # shellcheck disable=SC2154
# shellcheck disable=SC2034 # shellcheck disable=SC2034

View File

@ -2,7 +2,7 @@
# #
# ADD a new test skeleton to test dir, but does not activate test # ADD a new test skeleton to test dir, but does not activate test
# #
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# magic to ensure that we're always inside the root of our application, # magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script # no matter from which directory we'll run script

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# common variables # common variables
export TESTME DIRME TESTDIR LOGFILE REFDIR TESTNAME export TESTME DIRME TESTDIR LOGFILE REFDIR TESTNAME

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# this has to run once atfer git clone # this has to run once atfer git clone
# and every time we create new hooks # and every time we create new hooks
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# magic to ensure that we're always inside the root of our application, # magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script # no matter from which directory we'll run script

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
../dev/hooks/pre-commit.sh ../dev/hooks/pre-commit.sh

2
test/a-push-test.sh Executable file → Normal file
View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash #!/usr/bin/env bash
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
../dev/hooks/pre-push.sh ../dev/hooks/pre-push.sh

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# include common functions and definitions # include common functions and definitions
# shellcheck source=test/ALL-tests.inc.sh # shellcheck source=test/ALL-tests.inc.sh

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# include common functions and definitions # include common functions and definitions
# shellcheck source=test/ALL-tests.inc.sh # shellcheck source=test/ALL-tests.inc.sh

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# include common functions and definitions # include common functions and definitions
# shellcheck source=test/ALL-tests.inc.sh # shellcheck source=test/ALL-tests.inc.sh

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
#### $$VERSION$$ v0.70-dev2-21-g0cfb9f0 #### $$VERSION$$ v0.70-dev2-24-gfe4fb34
# include common functions and definitions # include common functions and definitions
# shellcheck source=test/ALL-tests.inc.sh # shellcheck source=test/ALL-tests.inc.sh