#!/bin/bash root="$(pwd)" branch=$(git symbolic-ref HEAD 2>/dev/null || echo "?") branch="${branch##refs/heads/}" if ! [ "$branch" = "main" ]; then exit 0; fi cleanup() { echo -e "\033[31mTests aborted.\033[0m" rm -rf "$root/.test"; exit; } trap cleanup SIGHUP SIGINT SIGABRT SIGTERM; cat <> "$root/.test/results" cd "$root/.test/repo" 2>> "$root/.test/results" || exit; if make test-ci &>> "$root/.test/results"; then grep 'Done fetching communities' -A1 --color=no "$root/.test/results"; cat <