#!/bin/bash
# BigLinux TTS — Speak selected text (CLI)
# This is a compatibility wrapper for older shortcuts.
# The actual logic has been fully ported to the Python application.

# Detect dev environment: if this script lives in a git repo, use its main.py
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
MAIN_PY="${SCRIPT_DIR}/../share/biglinux/tts-biglinux/main.py"

if [[ -f "$MAIN_PY" && -d "${SCRIPT_DIR}/../../.git" ]]; then
    exec python "${MAIN_PY}" --speak "$@"
fi

exec /usr/bin/biglinux-tts --speak "$@"
