#!/usr/bin/env bash
set -euo pipefail

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
CONFIGURATION="${CONFIGURATION:-Release}"

while [[ $# -gt 0 ]]; do
    case "$1" in
        -c | --configuration)
            CONFIGURATION="$2"
            shift 2
            ;;
        *)
            break
            ;;
    esac
done

cd "$ROOT"

dotnet build LittleSim.sln -c "$CONFIGURATION"
dotnet run --project src/LittleSim/LittleSim.csproj -c "$CONFIGURATION" --no-build "$@"
