refactor test

This commit is contained in:
Tom 2020-06-23 14:28:43 +02:00
parent 7f4a705ef2
commit 09acc1c9d5

View File

@ -7,15 +7,16 @@ for dir in rules/*
do
dir=${dir%*/}
echo ${dir##*/}
if test -f "$dir/metadata.json"; then
FILE="$dir/metadata.json"
if test -f $FILE; then
echo "$FILE exists."
HAS_TITLE=`cat $dir/metadata.json | jq 'has("title")'`
HAS_TITLE=`cat $FILE | jq 'has("title")'`
if [ "$HAS_TITLE" != "true" ]; then
echo "$dir/metadata.json has no title"
echo "$FILE has no title"
exit_code=1
fi
else
echo "no $dir/metadata.json"
echo "no $FILE"
exit_code=1
fi
done