Fix 'run' script, also do 'check' on modules that have validators.

This commit is contained in:
KtorZ 2023-03-16 23:01:32 +01:00
parent 4ed279b30d
commit 13890874c0
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
1 changed files with 13 additions and 7 deletions

View File

@ -16,14 +16,20 @@ TARGET="$WORKDIR/$(basename $1)"
TMP=$(mktemp) TMP=$(mktemp)
VALIDATORS=$(find $TARGET -type f -path "*validators/*.ak") VALIDATORS=$(find $TARGET -type f -path "*validators/*.ak")
if [ -z "$VALIDATORS" ]; then cargo run --quiet -- check $TARGET 1>$TMP 2>/dev/null
RESULT=$(cargo run --quiet -- check $TARGET 2>$TMP)
else
RESULT=$(cargo run --quiet -- build $TARGET 2>$TMP)
fi
if [ "$?" -eq "0" ]; then if [ "$?" -eq "0" ]; then
if [ -z "$VALIDATORS" ]; then
echo "✅ $(basename $TARGET)" echo "✅ $(basename $TARGET)"
else
cargo run --quiet -- build $TARGET 1>$TMP 2>/dev/null
if [ "$?" -eq "0" ]; then
echo "✅ $(basename $TARGET)"
else
echo "❌ $(basename $TARGET)"
cat $TMP
exit 1
fi
fi
else else
echo "❌ $(basename $TARGET)" echo "❌ $(basename $TARGET)"
cat $TMP cat $TMP