dev: adjust make-standalone

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2021-01-20 19:50:19 +01:00
parent 127cc85a2a
commit 749eee74a4
8 changed files with 60 additions and 60 deletions

View File

@ -30,7 +30,7 @@ BOTCOMMANDS="-h help init start stop status suspendback resumeback killb
# 8 - curl/wget missing
# 10 - not bash!
#
#### $$VERSION$$ v1.31-dev-12-g85a178d
#### $$VERSION$$ v1.31-dev-13-g127cc85
##################################################################
# emmbeded system may claim bash but it is not
@ -887,7 +887,6 @@ process_message() {
CHAT[ALL_ADMIN]="${UPD["result,${num},message,chat,all_members_are_administrators"]}"
# user ID is now parsed when update is received
#USER[ID]="${UPD["result,${num},message,from,id"]}"
USER[FIRST_NAME]="$(JsonDecode "${UPD["result,${num},message,from,first_name"]}")"
USER[LAST_NAME]="$(JsonDecode "${UPD["result,${num},message,from,last_name"]}")"
USER[USERNAME]="$(JsonDecode "${UPD["result,${num},message,from,username"]}")"

View File

@ -15,7 +15,7 @@
# This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#
#### $$VERSION$$ v1.30-0-g3266427
#### $$VERSION$$ v1.31-dev-13-g127cc85
#
# bashbot locale defaults to c.UTF-8, adjust locale in mycommands.sh if needed

View File

@ -11,7 +11,7 @@
# If you your bot is finished you can use make-standalone.sh to create the
# the old all-in-one bashbot: bashbot.sh and commands.sh only!
#
#### $$VERSION$$ v1.30-0-g3266427
#### $$VERSION$$ v1.31-dev-13-g127cc85
###################################################################
#shellcheck disable=SC1090
@ -73,13 +73,14 @@ printf "\n... create unified bashbot.sh\n"
# first head of bashbot.sh
sed -n '0,/for module in/ p' bashbot.sh | head -n -3
# then mycommands from first non comment line on
# then modules without shebang
printf '\n##############################\n# bashbot modules starts here ...\n'
cat modules/*.sh | sed -e 's/^#\!\/bin\/bash.*//'
# shellcheck disable=SC2016
cat modules/*.sh | sed -e 's/^#\!\/bin\/bash.*//' -e '/^#.*\$\$VERSION\$\$/d'
# last tail of commands.sh
printf '\n##############################\n# bashbot internal functions starts here ...\n\n'
sed -n '/BASHBOT INTERNAL functions/,$ p' bashbot.sh
# last remaining commands.sh
printf '\n##############################\n'
sed -n '/^# read commands file/,$ p' bashbot.sh
} >>$$bashbot.sh
@ -90,11 +91,11 @@ rm -rf modules
printf "Create minimized Version of bashbot.sh and commands.sh\n"
# shellcheck disable=SC2016
sed -E -e '/(shellcheck)|(^#!\/)|(\$\$VERSION\$\$)/! s/^[[:space:]]*#.*//' -e 's/^[[:space:]]*//' -e '/^$/d' -e 'N;s/\\\n/ /;P;D' bashbot.sh |\
sed 'N;s/\\\n/ /;P;D' > bashbot.sh.min
sed -E -e '/(shellcheck)|(^#!\/)|(\$\$VERSION\$\$)/! s/^[[:space:]]*#.*//' -e '/shellcheck/! s/\t+#.*//' -e 's/^[[:space:]]*//'\
-e '/^$/d' bashbot.sh | sed 'N;s/\\\n/ /;P;D' | sed 'N;s/\\\n/ /;P;D' > bashbot.sh.min
# shellcheck disable=SC2016
sed -E -e '/(shellcheck)|(^#!\/)|(\$\$VERSION\$\$)/! s/^[[:space:]]*#.*//' -e 's/^[[:space:]]*//' -e 's/\)[[:space:]]+#.*/)/' -e '/^$/d' commands.sh |\
sed 'N;s/\\\n/ /;P;D' > commands.sh.min
sed -E -e '/(shellcheck)|(^#!\/)|(\$\$VERSION\$\$)/! s/^[[:space:]]*#.*//' -e '/shellcheck/! s/\t+#.*//' -e 's/^[[:space:]]*//'\
-e '/^$/d' commands.sh | sed 'N;s/\\\n/ /;P;D' > commands.sh.min
chmod +x bashbot.sh.min
# make html doc

View File

@ -1,11 +1,11 @@
#!/bin/bash
# file: modules/alaises.sh
# file: modules/aliases.sh
# do not edit, this file will be overwritten on update
# This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#
#### $$VERSION$$ v1.30-0-g3266427
#### $$VERSION$$ v1.31-dev-13-g127cc85
#
# will be automatically sourced from bashbot

View File

@ -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$$ v1.30-0-g3266427
#### $$VERSION$$ v1.31-dev-13-g127cc85
# will be automatically sourced from bashbot

View File

@ -6,7 +6,7 @@
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#
# shellcheck disable=SC1117,SC2059
#### $$VERSION$$ v1.30-0-g3266427
#### $$VERSION$$ v1.31-dev-13-g127cc85
# will be automatically sourced from bashbot

View File

@ -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$$ v1.30-0-g3266427
#### $$VERSION$$ v1.31-dev-13-g127cc85
#
# source from commands.sh to use jsonDB functions
#

View File

@ -6,7 +6,7 @@
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#
# shellcheck disable=SC1117
#### $$VERSION$$ v1.31-dev-9-g6c91a32
#### $$VERSION$$ v1.31-dev-13-g127cc85
# will be automatically sourced from bashbot