Unit-test: Only use shellcheck if easyrsa is present in ./easyrsa3/

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2022-04-03 22:03:58 +01:00
parent 7227adcca2
commit ee51c1cc91
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246

View File

@ -9,14 +9,22 @@ github_url='https://raw.githubusercontent.com'
if [ -e "shellcheck" ] && [ "$EASYRSA_NIX" ]; then
chmod +x shellcheck
./shellcheck -V
./shellcheck easyrsa3/easyrsa
if [ -e easyrsa3/easyrsa ];then
./shellcheck easyrsa3/easyrsa
else
echo "* easyrsa binary not present, using path, no shellcheck"
fi
elif [ "$EASYRSA_NIX" ]; then
github_target='OpenVPN/easyrsa-unit-tests/master/shellcheck'
curl -O "${github_url}/${github_target}"
[ -e "shellcheck" ] || { echo "shellcheck download failed."; exit 9; }
chmod +x shellcheck
./shellcheck -V
./shellcheck easyrsa3/easyrsa
if [ -e easyrsa3/easyrsa ];then
./shellcheck easyrsa3/easyrsa
else
echo "* easyrsa binary not present, using path, no shellcheck"
fi
rm -f ./shellcheck
fi
@ -30,7 +38,9 @@ estat=0
if [ -e "easyrsa-unit-tests.sh" ]; then
if sh easyrsa-unit-tests.sh "$verb"; then
: # ok
if [ "$EASYRSA_NIX" ]; then
sh easyrsa-unit-tests.sh "$verb" -x || estat=2
fi
else
estat=1
fi