dev: make-standalone: improvments, extra files, make-dist: exclude test

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2021-03-07 09:09:48 +01:00
parent ae525c47e0
commit 41e6883817
5 changed files with 15 additions and 9 deletions

View File

@ -21,7 +21,7 @@ USAGE='process_update.sh [-h|--help] [-s|--startbot] [-w|--watch] [-n|--lines n]
# AUTHOR: KayM (gnadelwartz), kay@rrr.de # AUTHOR: KayM (gnadelwartz), kay@rrr.de
# CREATED: 27.02.2021 13:14 # CREATED: 27.02.2021 13:14
# #
#### $$VERSION$$ v1.45-dev-80-g2463866 #### $$VERSION$$ v1.45-dev-84-gae525c4
#=============================================================================== #===============================================================================
#### ####
@ -62,7 +62,7 @@ if [ -n "${startbot}" ]; then
# warn when starting bot without pipe # warn when starting bot without pipe
[ -p "${file}" ] || printf "%(%c)T: %b\n" -1 "${ORANGE}Warning${NC}: File is not a pipe:${GREY} ${file##*/}${NC}" [ -p "${file}" ] || printf "%(%c)T: %b\n" -1 "${ORANGE}Warning${NC}: File is not a pipe:${GREY} ${file##*/}${NC}"
start_bot "$2" "webhook" start_bot "$2" "webhook"
printf "%(%c)T: %b\n" -1 "${GREEN}Bot start actions done, start reading updates ....${NN}" printf "%(%c)T: %b\n" -1 "${GREEN}Bot start actions done, start reading updates ....${NC}"
fi fi
# check file exist # check file exist
if [[ ! -r "${file}" || -d "${file}" ]]; then if [[ ! -r "${file}" || -d "${file}" ]]; then
@ -74,7 +74,7 @@ fi
# ready, do stuff here ----- # ready, do stuff here -----
# kill all sub processes on exit # kill all sub processes on exit
trap 'kill $(jobs -p) 2>/dev/null; send_normal_message "'"${BOTADMIN}"'" "Bot '"${BOTNAME}"' webhook stopped ..."; printf "%(%c)T: %s\n" -1 "Bot in batch mode killed!\n"' EXIT HUP QUIT trap 'kill $(jobs -p) 2>/dev/null; send_normal_message "'"${BOTADMIN}"'" "Bot '"${BOTNAME}"' webhook stopped ..."; printf "%(%c)T: %s\n" -1 "Bot in batch mode killed!"' EXIT HUP QUIT
# wait after (first) update to avoid processing to many in parallel # wait after (first) update to avoid processing to many in parallel
UPDWAIT="0.5" UPDWAIT="0.5"

View File

@ -7,7 +7,7 @@
# #
# Options: --notest - skip tests # Options: --notest - skip tests
# #
#### $$VERSION$$ v1.45-dev-83-g47a032d #### $$VERSION$$ v1.45-dev-84-gae525c4
############################################################## ##############################################################
#shellcheck disable=SC1090 #shellcheck disable=SC1090
@ -20,7 +20,7 @@ DISTDIR="./DIST/${DISTNAME}"
DISTMKDIR="data-bot-bash logs bin bin/logs addons" DISTMKDIR="data-bot-bash logs bin bin/logs addons"
DISTFILES="bashbot.sh commands.sh mycommands.sh.clean bin doc examples scripts modules LICENSE README.md README.txt README.html" DISTFILES="bashbot.sh commands.sh mycommands.sh.clean bin doc examples scripts modules LICENSE README.md README.txt README.html"
DISTFILESDEV="dev/make-standalone.sh dev/inject-json.sh dev/make-html.sh dev/obfuscate.sh" DISTFILESDEV="dev/make-standalone.sh dev/make-standalone.sh.include dev/inject-json.sh dev/make-html.sh dev/obfuscate.sh"
DISTFILESDIST="mycommands.sh mycommands.conf bashbot.rc $(echo "addons/"*.sh)" DISTFILESDIST="mycommands.sh mycommands.conf bashbot.rc $(echo "addons/"*.sh)"
# run tests first! # run tests first!
@ -40,7 +40,7 @@ mkdir -p "${DISTDIR}" 2>/dev/null
printf "Copy files\n" printf "Copy files\n"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
cp -r ${DISTFILES} "${DISTDIR}" cp -r ${DISTFILES} "${DISTDIR}"
mkdir "${DISTDIR}/dev" mkdir -p "${DISTDIR}/dev"
# shellcheck disable=SC2086 # shellcheck disable=SC2086
cp ${DISTFILESDEV} "${DISTDIR}/dev" cp ${DISTFILESDEV} "${DISTDIR}/dev"
cd "${DISTDIR}" || exit 1 cd "${DISTDIR}" || exit 1

View File

@ -1,5 +1,7 @@
STANDALONE
data-bot-bash/* data-bot-bash/*
webhook-fifo test
webhook-fifo*
JSON.awk JSON.awk
bashbot.rc bashbot.rc
mycommands.sh mycommands.sh

View File

@ -11,7 +11,7 @@
# If you your bot is finished you can use make-standalone.sh to create the # 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! # the old all-in-one bashbot: bashbot.sh and commands.sh only!
# #
#### $$VERSION$$ v1.45-dev-83-g47a032d #### $$VERSION$$ v1.45-dev-84-gae525c4
################################################################### ###################################################################
# include git config and change to base dir # include git config and change to base dir
@ -37,9 +37,12 @@ fi
#DISTNAME="telegram-bot-bash" #DISTNAME="telegram-bot-bash"
DISTDIR="./STANDALONE" DISTDIR="./STANDALONE"
DISTMKDIR="data-bot-bash logs bin/logs addons" DISTMKDIR="data-bot-bash logs bin/logs addons"
DISTFILES="bashbot.sh bashbot.rc commands.sh mycommands.sh dev/obfuscate.sh modules scripts LICENSE README.* doc botacl botconfig.jssh addons" DISTFILES="bashbot.sh bashbot.rc commands.sh mycommands.sh modules scripts LICENSE README.* doc botacl botconfig.jssh addons"
DISTBINFILES="bin/bashbot_env.inc.sh bin/bashbot_stats.sh bin/process_batch.sh bin/process_update.sh bin/send_broadcast.sh bin/send_message.sh" DISTBINFILES="bin/bashbot_env.inc.sh bin/bashbot_stats.sh bin/process_batch.sh bin/process_update.sh bin/send_broadcast.sh bin/send_message.sh"
# add extra files
DISTFILES+=" $(cat "${BASE_DIR}/dev/${0##*/}.include")"
# create dir for distribution and copy files # create dir for distribution and copy files
printf "Create directories and copy files\n" printf "Create directories and copy files\n"
mkdir -p "${DISTDIR}/bin" 2>/dev/null mkdir -p "${DISTDIR}/bin" 2>/dev/null

View File

@ -0,0 +1 @@
dev/obfuscate.sh