no zero byte files

This commit is contained in:
Kay Marquardt (Gnadelwartz) 2019-04-20 21:31:05 +02:00
parent 31834194ad
commit 753f1b3b16
6 changed files with 16 additions and 10 deletions

View File

@ -10,7 +10,7 @@
# This file is public domain in the USA and all free countries.
# Elsewhere, consider it to be WTFPLv2. (wtfpl.net/txt/copying)
#
#### $$VERSION$$ 0.70-dev-18-g7512681
#### $$VERSION$$ 0.70-dev-19-g3183419
#
# Exit Codes:
# - 0 sucess (hopefully)
@ -82,7 +82,7 @@ fi
BOTACL="./botacl"
if [ ! -f "${BOTACL}" ]; then
echo -e "${ORANGE}Create empty ${BOTACL} file.${NC}"
touch "${BOTACL}"
echo "" >"${BOTACL}"
fi
TMPDIR="./tmp-bot-bash"
@ -97,7 +97,7 @@ fi
COUNTFILE="./count"
if [ ! -f "${COUNTFILE}" ]; then
touch "${COUNTFILE}"
echo "" >"${COUNTFILE}"
elif [ ! -w "${COUNTFILE}" ]; then
${CLEAR}
echo -e "${RED}ERROR: Can't write to ${COUNTFILE}!.${NC}"

View File

@ -1,7 +1,7 @@
#!/usr/bin/env bash
# this has to run once atfer git clone
# and every time we create new hooks
#### $$VERSION$$ 0.70-dev-18-g7512681
#### $$VERSION$$ 0.70-dev-19-g3183419
# magic to ensure that we're always inside the root of our application,
# no matter from which directory we'll run script
@ -40,11 +40,12 @@ done
if [ "$fail" -eq 0 ]; then
/bin/echo -n 'SUCCESS '
exitcode=0
rm -rf "${TESTENV}"
else
/bin/echo -n 'FAILURE '
exitcode=1
echo "To analyse error see ${TESTENV}"
fi
#rm -rf "${TESTENV}"
echo "${passed} / ${tests}"
exit ${exitcode}

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ 0.70-dev-18-g7512681
#### $$VERSION$$ 0.70-dev-19-g3183419
../dev/hooks/pre-commit.sh

View File

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#### $$VERSION$$ 0.70-dev-18-g7512681
#### $$VERSION$$ 0.70-dev-19-g3183419
../dev/hooks/pre-push.sh

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash
#### $$VERSION$$ 0.70-dev-18-g7512681
#### $$VERSION$$ 0.70-dev-19-g3183419
TESTME="$(basename "$0")"
DIRME="$(pwd)"
@ -33,13 +33,15 @@ EOF
echo "OK"
# compare files with refrence files
echo "Check check new files ..."
echo "Check new files after init ..."
export FAIL="0"
for file in ${TESTFILES}
do
ls -d "${TESTDIR}/${file}" >>"${LOGFILE}"
diff -q "${TESTDIR}/${file}" "${REFDIR}/${file}" >>"${LOGFILE}"
if ! diff -q "${TESTDIR}/${file}" "${REFDIR}/${file}" >>"${LOGFILE}"; then echo " ERROR: Fail diff ${file}!"; FAIL="1"; fi
done
[ "${FAIL}" != "0" ] && exit "${FAIL}"
echo "OK"
echo "Test Sourcing of bashbot.sh ..."
@ -54,3 +56,5 @@ cd "${DIRME}" || exit 1
echo "Test bashbot.sh count"
cp "${REFDIR}/count.test" "${TESTDIR}/count"
"${TESTDIR}/bashbot.sh" count
exit 1

View File

@ -0,0 +1 @@