#!/usr/bin/env bash
# Simple shell script to validate opencode and pwsh inside running container or local environment
CONTAINER_NAME=${1:-wordpress-plugin-ai-builder}

if command -v docker > /dev/null 2>&1; then
  echo "Running checks inside container: $CONTAINER_NAME"
  docker compose exec $CONTAINER_NAME pwsh -NoProfile -Command "pwsh --version; node --version; opencode --version; . /root/.config/powershell/Microsoft.PowerShell_profile.ps1; Get-Command github"
else
  echo "Docker not found - running local checks"
  pwsh --version
  node --version
  if command -v opencode > /dev/null 2>&1; then
    opencode --version
  else
    echo "opencode not found"; exit 1
  fi
fi

echo "Checks completed."
