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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1 @@