#!/bin/bash ERRORS=$(python3 -c "import os; [f for f in os.listdir('./tools') if f.endswith('.py') and os.path.getsize(os.path.join('./tools', f)) > 2048]") if [ -z "$ERRORS" ]; then echo "Compiling tools/*.py..." if python3 -m compileall tools/*.py; then echo "OK" else echo "Compilation failed" exit 1 fi else echo "You need to refactor this:" echo "$ERRORS" exit 1 fi