#!/bin/sh
set -eu

if [ "${AGENT_TEAMS_AI_BIN:-}" != "" ]; then
  exec "$AGENT_TEAMS_AI_BIN" "$@"
fi

for executable in \
  "/opt/Agent-Teams-AI/agent-teams-ai" \
  "/opt/Agent Teams AI/agent-teams-ai"
do
  if [ -x "$executable" ]; then
    exec "$executable" "$@"
  fi
done

echo "agent-teams-ai: installed app executable was not found under /opt/Agent-Teams-AI" >&2
exit 127
