From cd2e21e89f8137eeda357e652dcb9aebffd539b6 Mon Sep 17 00:00:00 2001 From: Thales Macedo Garitezi Date: Wed, 26 Apr 2023 15:03:13 -0300 Subject: [PATCH] ci: check if given schema.json exists before running spellcheck Prints helpful message when schema.json does not exist, as otherwise the "file" will be mounted as an empty directory inside the spellchecker container. --- scripts/spellcheck/spellcheck.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/spellcheck/spellcheck.sh b/scripts/spellcheck/spellcheck.sh index 57ea21c55..ac32359d8 100755 --- a/scripts/spellcheck/spellcheck.sh +++ b/scripts/spellcheck/spellcheck.sh @@ -12,6 +12,11 @@ else SCHEMA="$(realpath "$1")" fi +if ! [ -f "$SCHEMA" ]; then + echo "Schema file $SCHEMA does not exist; did you forget to run 'make emqx{,-enterprise}' ?" + exit 1 +fi + set +e docker run --rm -i --name spellcheck \ -v "${PROJ_ROOT}"/scripts/spellcheck/dicts:/dicts \