mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-12-28 04:45:00 +00:00
dev/: fix missing ${xxx}
This commit is contained in:
parent
641727dc99
commit
9ef8778f85
@ -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}"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
#
|
||||
# Usage: source inject-json.sh
|
||||
#
|
||||
#### $$VERSION$$ v1.21-0-gc85af77
|
||||
#### $$VERSION$$ v1.25-dev-6-g641727d
|
||||
##############################################################
|
||||
|
||||
# download JSON.sh
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user