From 96aae9d40ea7f1b7ccb628cf233e08706546b8e0 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Thu, 25 Apr 2019 14:45:16 +0200 Subject: [PATCH] finally auto add only changed files ... --- README.md | 2 +- README.txt | 2 +- bashbot.rc | 2 +- bashbot.sh | 2 +- commands.sh | 2 +- dev/git-add.sh | 21 +++++++++++++++++++++ dev/hooks/pre-commit.sh | 5 ++++- dev/hooks/pre-push.sh | 5 ++++- dev/install-hooks.sh | 2 +- dev/make-dist.sh | 2 +- dev/shellcheck.files | 2 +- dev/version.sh | 2 +- doc/0_install.md | 2 +- doc/1_firstbot.md | 2 +- doc/2_usage.md | 2 +- doc/3_advanced.md | 2 +- doc/4_expert.md | 2 +- doc/5_practice.md | 2 +- doc/6_reference.md | 2 +- doc/7_develop.md | 2 +- doc/8_custom.md | 2 +- examples/bashbot.cron | 2 +- examples/calc.sh | 2 +- examples/notify.sh | 2 +- examples/question,sh | 2 +- examples/question.sh | 2 +- modules/aliases.sh | 2 +- modules/background.sh | 2 +- modules/inline.sh | 2 +- mycommands.sh | 2 +- 30 files changed, 56 insertions(+), 29 deletions(-) create mode 100755 dev/git-add.sh diff --git a/README.md b/README.md index a62d5d8..fc8415a 100644 --- a/README.md +++ b/README.md @@ -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! -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 diff --git a/README.txt b/README.txt index b52566a..b3e2e30 100644 --- a/README.txt +++ b/README.txt @@ -123,5 +123,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\]] v0.70-dev2-26-g163635d +latexmath:[\[VERSION\]] v0.70-dev2-27-g2da31c1 ++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/bashbot.rc b/bashbot.rc index ca02ed2..3d700cc 100755 --- a/bashbot.rc +++ b/bashbot.rc @@ -1,7 +1,7 @@ #!/bin/sh # description: Start or stop telegram-bash-bot # -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 # shellcheck disable=SC2009 # shellcheck disable=SC2181 diff --git a/bashbot.sh b/bashbot.sh index d8dbe00..97fb021 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -12,7 +12,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev3-1-g55dab95 # # Exit Codes: # - 0 sucess (hopefully) diff --git a/commands.sh b/commands.sh index 2c05895..775fe99 100644 --- a/commands.sh +++ b/commands.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 # # shellcheck disable=SC2154 # shellcheck disable=SC2034 diff --git a/dev/git-add.sh b/dev/git-add.sh new file mode 100755 index 0000000..4ea7e2a --- /dev/null +++ b/dev/git-add.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# file: git-add.sh +# +# works together with git pre-push.sh and add all changed files sind last push + +#### $$VERSION$$ v0.70-dev3-1-g55dab95 + +# magic to ensure that we're always inside the root of our application, +# no matter from which directory we'll run script +GIT_DIR=$(git rev-parse --git-dir) +cd "$GIT_DIR/.." || exit 1 + +FILES="$(find ./* -newer .git/.lastpush)" +[ "${FILES}" = "" ] && echo "Noting changed since last push!" && exit + +# shellcheck disable=SC2086 +echo Add ${FILES} to repo ... + +# shellcheck disable=SC2086 +git add ${FILES} + diff --git a/dev/hooks/pre-commit.sh b/dev/hooks/pre-commit.sh index c67a68c..d753d0a 100755 --- a/dev/hooks/pre-commit.sh +++ b/dev/hooks/pre-commit.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev3-0-g2da31c1 + +############ +# NOTE: you MUST run install-hooks.sh again when updating this file! # 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 3cad476..6d64dd1 100755 --- a/dev/hooks/pre-push.sh +++ b/dev/hooks/pre-push.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev3-0-g2da31c1 + +############ +# NOTE: you MUST run install-hooks.sh again when updating this file! # 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 44385b5..d528fb4 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$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 # 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/make-dist.sh b/dev/make-dist.sh index 654cbac..c9f054d 100755 --- a/dev/make-dist.sh +++ b/dev/make-dist.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$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 # 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 aaffc33..71221af 100644 --- a/dev/shellcheck.files +++ b/dev/shellcheck.files @@ -1,3 +1,3 @@ # list of additional files to check from shellcheck -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 bashbot.rc diff --git a/dev/version.sh b/dev/version.sh index 063ed7f..e2a459a 100755 --- a/dev/version.sh +++ b/dev/version.sh @@ -1,6 +1,6 @@ #!/bin/bash # -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 # shellcheck disable=SC2016 # # Easy Versioning in git: diff --git a/doc/0_install.md b/doc/0_install.md index 561283a..642c6e6 100644 --- a/doc/0_install.md +++ b/doc/0_install.md @@ -61,5 +61,5 @@ The old format is supported for backward compatibility, but may fail for corner #### [Next Create Bot](1_firstbot.md) -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 diff --git a/doc/1_firstbot.md b/doc/1_firstbot.md index 62c67f3..6db34b0 100644 --- a/doc/1_firstbot.md +++ b/doc/1_firstbot.md @@ -62,5 +62,5 @@ group. This step is up to you actually. #### [Prev Installation](0_install.md) #### [Next Getting started](2_usage.md) -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 diff --git a/doc/2_usage.md b/doc/2_usage.md index b16f224..e4e211a 100644 --- a/doc/2_usage.md +++ b/doc/2_usage.md @@ -166,5 +166,5 @@ send_action "${CHAT[ID]}" "action" #### [Prev Create Bot](1_firstbot.md) #### [Next Advanced Usage](3_advanced.md) -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 diff --git a/doc/3_advanced.md b/doc/3_advanced.md index 3d9317a..6ce711d 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$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 diff --git a/doc/4_expert.md b/doc/4_expert.md index 561cc13..9d985dd 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$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 diff --git a/doc/5_practice.md b/doc/5_practice.md index ecb7007..ef221a6 100644 --- a/doc/5_practice.md +++ b/doc/5_practice.md @@ -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) #### [Next Functions Reference](6_reference.md) -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 diff --git a/doc/6_reference.md b/doc/6_reference.md index 49a4859..5548129 100644 --- a/doc/6_reference.md +++ b/doc/6_reference.md @@ -445,5 +445,5 @@ Send Input from Telegram to waiting Interactive Chat. #### [Prev Best Practice](5_practice.md) #### [Next Notes for Developers](7_develop.md) -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 diff --git a/doc/7_develop.md b/doc/7_develop.md index d07df44..41664cb 100644 --- a/doc/7_develop.md +++ b/doc/7_develop.md @@ -71,5 +71,5 @@ fi #### [Prev Function Reference](6_function.md) #### [Next Bashbot Environment](8_custom.md) -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 diff --git a/doc/8_custom.md b/doc/8_custom.md index a07c1c5..ac762ea 100644 --- a/doc/8_custom.md +++ b/doc/8_custom.md @@ -131,5 +131,5 @@ for every poll until the maximum of BASHBOT_SLEEP ms. #### [Prev Notes for Developers](7_develop.md) -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 diff --git a/examples/bashbot.cron b/examples/bashbot.cron index 19d29bb..ff544eb 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$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 SHELL=/bin/sh diff --git a/examples/calc.sh b/examples/calc.sh index 14e773f..6ed05f1 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$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 # 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 e181a40..0f49de6 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$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 # 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 768751f..72578c0 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$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 # 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 768751f..72578c0 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$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 # adjust your language setting here # https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment diff --git a/modules/aliases.sh b/modules/aliases.sh index 982ce30..ea8e4b7 100644 --- a/modules/aliases.sh +++ b/modules/aliases.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 # # source from commands.sh to use the aliases diff --git a/modules/background.sh b/modules/background.sh index 592777d..89579f4 100644 --- a/modules/background.sh +++ b/modules/background.sh @@ -5,7 +5,7 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 # source from commands.sh if you want ro use interactive or background jobs diff --git a/modules/inline.sh b/modules/inline.sh index 075673e..2a32637 100644 --- a/modules/inline.sh +++ b/modules/inline.sh @@ -5,6 +5,6 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) # -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 # source from commands.sh to use the inline functions diff --git a/mycommands.sh b/mycommands.sh index a637a65..d8b896f 100644 --- a/mycommands.sh +++ b/mycommands.sh @@ -2,7 +2,7 @@ # files: mycommands.sh.dist # copy to mycommands.sh and add all your commands and functions here ... # -#### $$VERSION$$ v0.70-dev2-26-g163635d +#### $$VERSION$$ v0.70-dev2-27-g2da31c1 # # shellcheck disable=SC2154 # shellcheck disable=SC2034