Sfoglia il codice sorgente

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.
Thales Macedo Garitezi 2 anni fa
parent
commit
cd2e21e89f
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  1. 5 0
      scripts/spellcheck/spellcheck.sh

+ 5 - 0
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 \