solidity/scripts/chk_shellscripts/chk_shellscripts.sh

18 lines
362 B
Bash
Raw Permalink Normal View History

2020-03-31 18:05:58 +00:00
#!/usr/bin/env bash
set -eu
2020-03-31 18:05:58 +00:00
REPO_ROOT="$(dirname "$0")"/../..
REPO_ROOT=$(realpath "${REPO_ROOT}")
cd "${REPO_ROOT}"
SHELLCHECK=${SHELLCHECK:-"$(command -v -- shellcheck)"}
if [ ! -f "${SHELLCHECK}" ]; then
2020-12-11 17:15:16 +00:00
echo "error: shellcheck '${SHELLCHECK}' not found."
exit 1
2020-03-31 18:05:58 +00:00
fi
2020-12-12 02:47:23 +00:00
mapfile -t FILES < <(find . -type f -name "*.sh")
"${SHELLCHECK}" "${FILES[@]}"