mirror of
https://github.com/octoleo/telegram-bot-bash.git
synced 2024-11-22 15:35:09 +00:00
check if shellcheck is installed
This commit is contained in:
parent
8bb14ec909
commit
12fd839e72
@ -17,11 +17,20 @@ echo "............................"
|
||||
|
||||
unset IFS; set -f
|
||||
|
||||
# check for shellcheck
|
||||
if which shellcheck >/dev/null 2>&1; then
|
||||
echo "Test all scripts with shellcheck ..."
|
||||
else
|
||||
echo "Error: shellcheck is not installed. Install shellcheck or delete $0"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# run shellcheck before commit
|
||||
FILES=$(sed '/^#/d' <"hooks/shellcheck.files")
|
||||
if [ "$FILES" != "" ]; then
|
||||
# shellcheck disable=SC2086
|
||||
shellcheck -x ${FILES}
|
||||
shellcheck -x ${FILES} || exit 1
|
||||
echo "OK"
|
||||
else
|
||||
# something went wrong
|
||||
exit 1
|
||||
|
Loading…
Reference in New Issue
Block a user