From d24ef50fd4c30a4948b15a73ce59022bf8bfb248 Mon Sep 17 00:00:00 2001 From: "Kay Marquardt (Gnadelwartz)" Date: Sun, 28 Jun 2020 23:02:58 +0200 Subject: [PATCH] fix dist standalone, make shellcheck happy --- dev/make-distribution.sh | 4 ++-- dev/make-html.sh | 7 +++++-- dev/make-standalone.sh | 8 +++++--- modules/background.sh | 4 ++-- 4 files changed, 14 insertions(+), 9 deletions(-) mode change 100755 => 100644 dev/make-html.sh diff --git a/dev/make-distribution.sh b/dev/make-distribution.sh index 0d3657a..0b88df4 100755 --- a/dev/make-distribution.sh +++ b/dev/make-distribution.sh @@ -2,7 +2,7 @@ # file: make-distribution.sh # creates files and arcchives to dirtribute bashbot # -#### $$VERSION$$ v0.98-pre2-0-ga597303 +#### $$VERSION$$ v0.98-pre2-15-g1666cac # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script @@ -17,7 +17,7 @@ VERSION="$(git describe --tags | sed -e 's/-[0-9].*//' -e 's/v//')" DISTNAME="telegram-bot-bash" DISTDIR="./DIST/${DISTNAME}" -DISTFILES="bashbot.rc bashbot.sh commands.sh mycommands.sh mycommands.sh.clean doc examples logs scripts modules addons LICENSE README.md README.txt README.html" +DISTFILES="bashbot.rc bashbot.sh commands.sh mycommands.sh mycommands.sh.clean doc examples scripts modules addons LICENSE README.md README.txt README.html" # run tests first! diff --git a/dev/make-html.sh b/dev/make-html.sh old mode 100755 new mode 100644 index 795a1fd..c488263 --- a/dev/make-html.sh +++ b/dev/make-html.sh @@ -9,5 +9,8 @@ fi mkdir html 2>/dev/null cp README.html html/index.html find doc -iname "*.md" -type f -exec sh -c 'pandoc -s -f commonmark -M "title=Bashobot Documentation - ${0%.md}.html" "${0}" -o "./html/$(basename ${0%.md}.html)"' {} \; -find examples -iname "*.md" -type f -exec sh -c 'pandoc -s -f commonmark -M "title=Bashobot Documentation - ${0%.md}.html" "${0}" -o "${0%.md}.html"' {} \; -find README.html html examples -iname "*.html" -type f -exec sh -c 'sed -i -E "s/href=\"(\.\.\/)*doc\//href=\"\1html\//g;s/href=\"(.*).md(#.*)*\"/href=\"\1.html\"/g" ${0}' {} \; +if [ -d "examples" ]; then + find examples -iname "*.md" -type f -exec sh -c 'pandoc -s -f commonmark -M "title=Bashobot Documentation - ${0%.md}.html" "${0}" -o "${0%.md}.html"' {} \; + EXAMPLES="examples" +fi +find README.html html ${EXAMPLES} -iname "*.html" -type f -exec sh -c 'sed -i -E "s/href=\"(\.\.\/)*doc\//href=\"\1html\//g;s/href=\"(.*).md(#.*)*\"/href=\"\1.html\"/g" ${0}' {} \; diff --git a/dev/make-standalone.sh b/dev/make-standalone.sh index 27a0384..0c87cf5 100755 --- a/dev/make-standalone.sh +++ b/dev/make-standalone.sh @@ -5,7 +5,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$$ v0.98-pre2-0-ga597303 +#### $$VERSION$$ v0.98-pre2-15-g1666cac # magic to ensure that we're always inside the root of our application, # no matter from which directory we'll run script @@ -75,8 +75,10 @@ chmod +x bashbot.sh rm -rf modules echo "Create minimized Version of bashbot.sh and commands.sh" -sed -E -e '/(shellcheck)|(#!\/bin\/bash)/! s/^[[:space:]]*#.*//' -e 's/^[[:space:]]*//' -e '/^$/d' bashbot.sh > bashbot.sh.min -sed -E -e '/(shellcheck)|(#!\/bin\/bash)/! s/^[[:space:]]*#.*//' -e 's/^[[:space:]]*//' -e '/^$/d' commands.sh > commands.sh.min +sed -E -e '/(shellcheck)|(#!\/bin\/bash)/! 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)|(#!\/bin\/bash)/! s/^[[:space:]]*#.*//' -e 's/^[[:space:]]*//' -e '/^$/d' commands.sh |\ + sed 'N;s/\\\n/ /;P;D' > commands.sh.min chmod +x bashbot.sh.min # make html doc diff --git a/modules/background.sh b/modules/background.sh index 9946a32..2e8463f 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.98-pre2-13-g0e6712a +#### $$VERSION$$ v0.98-pre2-15-g1666cac # will be automatically sourced from bashbot @@ -114,7 +114,7 @@ send_interactive() { # old style but may not work because of local checks inproc() { - send_interactive "${CHAT[ID]}" "${MESSAGE}" + send_interactive "${CHAT[ID]}" "${MESSAGE[0]}" } # start stop all jobs