#!/usr/bin/env bash

echo `which iconscript`
if [ -d ".venv" ]; then
    source .venv/bin/activate
else
    echo "No virtual environment found."
    exit 1
fi

echo `which iconscript`
python_files="roentgen/"

echo "Checking Format with Ruff..."
if ! ruff format --check; then
    echo "FAIL"
    exit 1
fi

echo "Linting with Ruff..."
if ! ruff check; then
    echo "FAIL"
    exit 1
fi

echo `which iconscript`
echo "Checking icon generation..."
if ! python -m roentgen icons; then
    echo "FAIL"
    exit 1
fi

echo "Running tests..."
if ! pytest tests/ -v; then
    echo "FAIL"
    exit 1
fi

echo "OK"
