#!/usr/bin/env bash
# helperai-health-check — cross-platform launcher (per-OS python implementation).
set -euo pipefail
SCRIPT_DIR="$(cd -- "$(dirname -- "$0")" && pwd -P)"
ROOT_DIR="$(cd -- "$SCRIPT_DIR/.." && pwd -P)"
case "$(uname -s)" in
  Darwin) COMPONENT="$ROOT_DIR/components/macos/health-check/helperai_health_check.py" ;;
  Linux)  COMPONENT="$ROOT_DIR/components/linux/health-check/helperai_health_check.py" ;;
  MINGW*|MSYS*|CYGWIN*)
    COMPONENT="$ROOT_DIR/components/windows/health-check/helperai_health_check.py"
    # Python on Windows does not understand MSYS-style /d/... paths.
    if command -v cygpath >/dev/null 2>&1; then
      COMPONENT="$(cygpath -w "$COMPONENT")"
    fi ;;
  *) echo "error: helperai-health-check: unsupported OS: $(uname -s)" >&2; exit 64 ;;
esac
exec /usr/bin/env python3 "$COMPONENT" "$@"
