#!/bin/bash
# Launcher used by Meeting Helper.app — finds the meeting-helper CLI
# regardless of Spotlight's minimal PATH and exec's `meeting-helper gui`.
set -e
for prefix in \
    "$HOME/.local/bin" \
    /opt/homebrew/bin \
    /usr/local/bin \
    /usr/bin \
    "$HOME/.pyenv/shims" \
    "$HOME/.venv/bin"; do
  if [ -x "$prefix/meeting-helper" ]; then
    exec "$prefix/meeting-helper" gui
  fi
done
osascript -e 'display dialog "Could not find the `meeting-helper` command. Install it first via:\n\n  pipx install meeting-helper" with title "Meeting Helper" buttons {"OK"} default button "OK" with icon caution'
exit 1
