mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2025-04-11 08:31:51 +00:00
test for files after init
This commit is contained in:
parent
074a10336f
commit
2eac362dc7
@ -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-11-g41b8e69
|
#### $$VERSION$$ 0.70-dev-15-g074a103
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#### $$VERSION$$ 0.70-dev-11-g41b8e69
|
#### $$VERSION$$ 0.70-dev-15-g074a103
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#### $$VERSION$$ 0.70-dev-11-g41b8e69
|
#### $$VERSION$$ 0.70-dev-15-g074a103
|
||||||
|
|
||||||
# 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
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#### $$VERSION$$ 0.70-dev-11-g41b8e69
|
#### $$VERSION$$ 0.70-dev-15-g074a103
|
||||||
|
|
||||||
# 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
|
||||||
GIT_DIR=$(git rev-parse --git-dir)
|
GIT_DIR=$(git rev-parse --git-dir)
|
||||||
cd "$GIT_DIR/.." || exit 1
|
cd "$GIT_DIR/.." || exit 1
|
||||||
|
|
||||||
|
TOKENFILE="./token"
|
||||||
|
TESTTOKEN="bashbottestscript"
|
||||||
TESTME="$(basename "$0")"
|
TESTME="$(basename "$0")"
|
||||||
|
NEWFILES="${TOKENFILE} botacl count botadmin JSON.sh/JSON.sh tmp-bot-bash"
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# let's fake failing test for now
|
# let's fake failing test for now
|
||||||
@ -22,7 +26,24 @@ unset IFS; set -f
|
|||||||
# run bashbot first time with init
|
# run bashbot first time with init
|
||||||
export TERM=""
|
export TERM=""
|
||||||
"${1}/bashbot.sh" init >"${TESTME}.log" <<EOF
|
"${1}/bashbot.sh" init >"${TESTME}.log" <<EOF
|
||||||
bashbottestscript
|
$TESTTOKEN
|
||||||
nobody
|
nobody
|
||||||
botadmin
|
botadmin
|
||||||
EOF
|
EOF
|
||||||
|
echo "OK"
|
||||||
|
|
||||||
|
# files must exsit after init
|
||||||
|
echo "Check check new files ..."
|
||||||
|
for file in ${NEWFILES}
|
||||||
|
do
|
||||||
|
ls -d "${file}" >/dev/null
|
||||||
|
done
|
||||||
|
echo "OK"
|
||||||
|
|
||||||
|
echo "Check value of token ..."
|
||||||
|
if [ "${TESTTOKEN}" = "$(cat "${TOKENFILE}")" ]; then
|
||||||
|
echo "OK"
|
||||||
|
else
|
||||||
|
echo "Token not correct or not written!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user