# Set the shell to bash (default is sh)
set shell := ["bash", "-c"]

# List all available commands when someone just types 'just'
default:
    @just --list

# Run tests for ALL services (using find loop)
test-all: test-all-services
    cd cli && uv run pytest
    cd packages/agebd && uv run pytest
    cd scripts && uv run pytest

test-all-services:
    #!/usr/bin/env bash
    for dir in services/*/current/app; do
        if [ -d "$dir" ]; then
            (cd "$dir" && uv run pytest)
        fi
    done
    # find services -name "pyproject.toml" -execdir uv run pytest \;

# Sync all envs
sync-all:
    #!/usr/bin/env bash
    for dir in services/*/current/app; do
        if [ -d "$dir" ]; then
            (cd "$dir" && uv sync)
        fi
    done

# Run tests for a SPECIFIC service (e.g., 'just test master')
test service:
    cd services/{{service}}/current/app && uv run pytest
