From 851be8351822d24113884cf085d1aae01861d545 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Thu, 28 Mar 2019 16:51:33 +0100 Subject: [PATCH] prepare for v0.5, add version numbers to files --- README.md | 2 ++ bashbot.cron | 3 +++ bashbot.rc | 2 ++ bashbot.sh | 2 ++ commands.sh | 2 ++ notify | 1 + question | 1 + version | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 60 insertions(+) create mode 100755 version diff --git a/README.md b/README.md index 2a7ccb4..4cab429 100644 --- a/README.md +++ b/README.md @@ -423,3 +423,5 @@ An example crontab is provided in ```bashbot.cron```. ## That's it! If you feel that there's something missing or if you found a bug, feel free to submit a pull request! + +#### $$VERSION$$ v0.49-0-g64255eb diff --git a/bashbot.cron b/bashbot.cron index 0658243..55a9ff2 100644 --- a/bashbot.cron +++ b/bashbot.cron @@ -6,6 +6,9 @@ # # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) +# +#### $$VERSION$$ v0.49-0-g64255eb + SHELL=/bin/sh PATH=/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin: diff --git a/bashbot.rc b/bashbot.rc index a76bec9..b17913e 100755 --- a/bashbot.rc +++ b/bashbot.rc @@ -1,6 +1,8 @@ #!/bin/sh # description: Start or stop telegram-bash-bot # +#### $$VERSION$$ v0.49-0-g64255eb +# ### BEGIN INIT INFO # Provides: bashbot # Required-Start: $network $syslog diff --git a/bashbot.sh b/bashbot.sh index 6a4588e..479bfd2 100755 --- a/bashbot.sh +++ b/bashbot.sh @@ -9,6 +9,8 @@ # and on tmux (http://github.com/tmux/tmux) (BSD). # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) +# +#### $$VERSION$$ v0.49-0-g64255eb # get location of bashbot.sh an change to bashbot dir SCRIPT="./$(basename $0)" diff --git a/commands.sh b/commands.sh index 82a92b7..cc948cd 100755 --- a/commands.sh +++ b/commands.sh @@ -3,6 +3,8 @@ # This file is public domain in the USA and all free countries. # Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying) +# +#### $$VERSION$$ v0.49-0-g64255eb # adjust your language setting here, e.g.when run from other user or cron. # https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment diff --git a/notify b/notify index 62986e7..52c6e56 100755 --- a/notify +++ b/notify @@ -2,6 +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.49-0-g64255eb # adjust your language setting here # https://github.com/topkecleon/telegram-bot-bash#setting-up-your-environment diff --git a/question b/question index d343b2c..c7273a1 100755 --- a/question +++ b/question @@ -2,6 +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.49-0-g64255eb echo "Why hello there. Would you like some tea (y/n)?" diff --git a/version b/version new file mode 100755 index 0000000..76f880d --- /dev/null +++ b/version @@ -0,0 +1,47 @@ +#!/bin/sh +# +# Easy Versioning in git: +# +# for setting your Version in git use e.g.: +# git tag -a v0.5 -m 'Version 0.5' +# +# Push tags upstream—this is not done by default: +# git push --tags +# +# # in case of a wrong tag remove it: +# git tag -d v0.5 +# +# delete remote tag (eg, GitHub version) +# git push origin :refs/tags/v0.5 +# +# Then use the describe command: +# +# git describe --tags --long +# This gives you a string of the format: +# +# v0.5-0-gdeadbee +# ^ ^ ^^ +# | | || +# | | |'-- SHA of HEAD (first seven chars) +# | | '-- "g" is for git +# | '---- number of commits since last tag +# | +# '--------- last tag +# +# run this script to (re)place Version number in files +# +#### $$VERSION$$ v0.49-0-g64255eb +# + +VERSION="`git describe --tags --long`" +echo "Update files to version $VERSION ..." + +for file in `ls` +do + [ ! -f "$file" ] && continue + #[ "$file" == "version" ] && continue + echo -n " $file" + sed -i 's/^#### $$VERSION$$.*/#### \$\$VERSION\$\$ '$VERSION'/' $file +done +echo " done." +