dev/: fix missing ${xxx}

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2021-01-05 11:40:28 +01:00
parent 641727dc99
commit 9ef8778f85
9 changed files with 39 additions and 38 deletions

View File

@ -5,14 +5,14 @@
#
# Description: run all tests, exit after failed test
#
#### $$VERSION$$ v1.21-0-gc85af77
#### $$VERSION$$ v1.25-dev-6-g641727d
#############################################################
# 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 2>/dev/null)
if [ "$GIT_DIR" != "" ] ; then
cd "$GIT_DIR/.." || exit 1
if [ "${GIT_DIR}" != "" ] ; then
cd "${GIT_DIR}/.." || exit 1
else
printf "Sorry, no git repository %s\n" "$(pwd)" && exit 1
fi
@ -52,7 +52,7 @@ do
"${test}" "${TESTENV}"
ret=$?
set +e
if [ "$ret" -eq 0 ] ; then
if [ "${ret}" -eq 0 ] ; then
printf "OK: ---- %s\n" "${test}"
passed=$((passed+1))
else
@ -64,7 +64,7 @@ done
###########################
# cleanup depending on test state
if [ "$fail" -eq 0 ]; then
if [ "${fail}" -eq 0 ]; then
printf 'SUCCESS '
exitcode=0
rm -rf "${TESTENV}"
@ -82,4 +82,4 @@ printf "%s\n\n" "${passed} / ${tests}"
ls -ld /tmp/bashbot.test* 2>/dev/null && printf "Do not forget to delete bashbot test files in /tmp!!\n"
exit ${exitcode}
exit "${exitcode}"

View File

@ -3,13 +3,13 @@
#
# works together with git pre-push.sh and ADD all changed files since last push
#### $$VERSION$$ v1.21-0-gc85af77
#### $$VERSION$$ v1.25-dev-6-g641727d
# 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 2>/dev/null)
if [ "$GIT_DIR" != "" ] ; then
cd "$GIT_DIR/.." || exit 1
if [ "${GIT_DIR}" != "" ] ; then
cd "${GIT_DIR}/.." || exit 1
else
printf "Sorry, no git repository %s\n" "$(pwd)" && exit 1
fi
@ -31,7 +31,7 @@ for file in ${FILES}
do
[ -d "${file}" ] && continue
printf "%s" "${file} "
git add "$file"
git add "${file}"
done
printf " - Done.\n"

View File

@ -7,7 +7,7 @@
#
# Usage: source inject-json.sh
#
#### $$VERSION$$ v1.21-0-gc85af77
#### $$VERSION$$ v1.25-dev-6-g641727d
##############################################################
# download JSON.sh

View File

@ -1,13 +1,13 @@
#!/usr/bin/env bash
# this has to run once atfer git clone
# and every time we create new hooks
#### $$VERSION$$ v1.21-0-gc85af77
#### $$VERSION$$ v1.25-dev-6-g641727d
# 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 2>/dev/null)
if [ "$GIT_DIR" != "" ] ; then
cd "$GIT_DIR/.." || exit 1
if [ "${GIT_DIR}" != "" ] ; then
cd "${GIT_DIR}/.." || exit 1
else
printf "Sorry, no git repository %s\n" "$(pwd)" && exit 1
fi
@ -19,7 +19,7 @@ for hook in pre-commit post-commit pre-push
do
rm -f "${GIT_DIR}/hooks/${hook}"
if [ -f "${HOOKDIR}/${hook}.sh" ]; then
printf "%s"" $hook"
printf "%s"" ${hook}"
ln -s "../../${HOOKDIR}/${hook}.sh" "${GIT_DIR}/hooks/${hook}"
fi
done

View File

@ -7,15 +7,15 @@
#
# Options: --notest - skip tests
#
#### $$VERSION$$ v1.21-0-gc85af77
#### $$VERSION$$ v1.25-dev-6-g641727d
##############################################################
# 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 2>/dev/null)
if [ "$GIT_DIR" != "" ] ; then
[[ "$GIT_DIR" != "/"* ]] && GIT_DIR="${PWD}/${GIT_DIR}"
cd "$GIT_DIR/.." || exit 1
if [ "${GIT_DIR}" != "" ] ; then
[[ "${GIT_DIR}" != "/"* ]] && GIT_DIR="${PWD}/${GIT_DIR}"
cd "${GIT_DIR}/.." || exit 1
else
printf "Sorry, no git repository %s\n" "$(pwd)" && exit 1
fi
@ -47,6 +47,7 @@ cp -r ${DISTFILES} "${DISTDIR}"
cd "${DISTDIR}" || exit 1
printf "Create directories\n"
# shellcheck disable=SC2250
for dir in $DISTMKDIR
do
[ ! -d "${dir}" ] && mkdir "${dir}"
@ -62,7 +63,7 @@ done
# inject JSON.sh into distribution
# shellcheck disable=SC1090
source "$GIT_DIR/../dev/inject-json.sh"
source "${GIT_DIR}/../dev/inject-json.sh"
# make html doc
printf "Create html doc\n"
@ -73,13 +74,13 @@ source "../../dev/make-html.sh"
cd .. || exit 1
printf "Create dist archives\n"
# shellcheck disable=SC2046
zip -rq - "${DISTNAME}" --exclude $(cat "$GIT_DIR/../dev/${0##*/}.exclude") >"${DISTNAME}-${VERSION}.zip"
tar --exclude-ignore="$GIT_DIR/../dev/${0##*/}.exclude" -czf "${DISTNAME}-${VERSION}.tar.gz" "${DISTNAME}"
zip -rq - "${DISTNAME}" --exclude $(cat "${GIT_DIR}/../dev/${0##*/}.exclude") >"${DISTNAME}-${VERSION}.zip"
tar --exclude-ignore="${GIT_DIR}/../dev/${0##*/}.exclude" -czf "${DISTNAME}-${VERSION}.tar.gz" "${DISTNAME}"
printf "%s Done!\n" "$0"
# shellcheck disable=SC2086
ls -ld ${DISTNAME}-${VERSION}.*
ls -ld "${DISTNAME}-${VERSION}".*
# an empty DEBUG.log is created ... :-(
rm -f "$GIT_DIR/../test/"*.log
rm -f "${GIT_DIR}/../test/"*.log

View File

@ -7,7 +7,7 @@
#
# Usage: source make-hmtl
#
#### $$VERSION$$ v1.21-0-gc85af77
#### $$VERSION$$ v1.25-dev-6-g641727d
##############################################################
# check for correct dir
@ -36,7 +36,7 @@ else
'printf "."; pandoc -s -f commonmark -M "title=Bashobot Documentation - ${0%.md}.html" "${0}" -o "${0%.md}.html"' {} \;
fi
# final: convert links from *.md to *.html
find README.html html ${EXAMPLES} -iname "*.html" -type f -exec sh -c\
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}' {} \;
printf " Done!\n"
fi

View File

@ -9,21 +9,21 @@
# 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.21-0-gc85af77
#### $$VERSION$$ v1.25-dev-6-g641727d
###################################################################
# 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 2>/dev/null)
if [ "$GIT_DIR" != "" ] ; then
[[ "$GIT_DIR" != "/"* ]] && GIT_DIR="${PWD}/${GIT_DIR}"
cd "$GIT_DIR/.." || exit 1
if [ "${GIT_DIR}" != "" ] ; then
[[ "${GIT_DIR}" != "/"* ]] && GIT_DIR="${PWD}/${GIT_DIR}"
cd "${GIT_DIR}/.." || exit 1
else
[ ! -f "bashbot.sh" ] && printf "bashbot.sh not found in %s\n" " $(pwd)" && exit 1
fi
#DISTNAME="telegram-bot-bash"
DISTDIR="./STANDALONE/${DISTNAME}"
DISTDIR="./STANDALONE"
DISTFILES="bashbot.sh bashbot.rc commands.sh mycommands.sh dev/obfuscate.sh modules scripts logs LICENSE README.* doc botacl botconfig.jssh"
# run pre_commit on files
@ -37,7 +37,7 @@ cd "${DISTDIR}" || exit 1
# inject JSON.sh into distribution
# shellcheck disable=SC1090
source "$GIT_DIR/../dev/inject-json.sh"
source "${GIT_DIR}/../dev/inject-json.sh"
#######################
# here the magic starts
@ -95,7 +95,7 @@ chmod +x bashbot.sh.min
# make html doc
printf "Create html doc\n"
#shellcheck disable=SC1090
source "$GIT_DIR/../dev/make-html.sh"
source "${GIT_DIR}/../dev/make-html.sh"
printf "%s Done!\n" "$0"

View File

@ -2,7 +2,7 @@
#
# joke hack to obfuscate bashbot.min.sh
#
#### $$VERSION$$ v1.21-0-gc85af77
#### $$VERSION$$ v1.25-dev-6-g641727d
# shellcheck disable=SC2028,SC2016,SC1117
infile="bashbot.sh"

View File

@ -1,6 +1,6 @@
#!/bin/bash
#
#### $$VERSION$$ v1.21-0-gc85af77
#### $$VERSION$$ v1.25-dev-6-g641727d
# shellcheck disable=SC2016
#
# Easy Versioning in git:
@ -37,8 +37,8 @@
# 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 2>/dev/null)
if [ "$GIT_DIR" != "" ] ; then
cd "$GIT_DIR/.." || exit 1
if [ "${GIT_DIR}" != "" ] ; then
cd "${GIT_DIR}/.." || exit 1
else
printf "Sorry, no git repository %s\n" "$(pwd)" && exit 1
fi
@ -52,7 +52,7 @@ printf "Update to version %s ...\n" "${VERSION}"
FILES="$(find ./*)"
[ "$1" != "" ] && FILES="$*"
for file in $FILES
for file in ${FILES}
do
[ ! -f "${file}" ] && continue
#[ "${file}" == "version" ] && continue