#!/bin/bash
# Morning briefing runner
set -e

# Load env vars from dedicated file
ENV_FILE="/home/thesage/.hermes/.env"
if [ -f "$ENV_FILE" ]; then
    set -a
    source "$ENV_FILE"
    set +a
fi

# Also try user profile (fallback)
if [ -f ~/.bashrc ]; then source ~/.bashrc > /dev/null 2>&1; fi
if [ -f ~/.zshrc ]; then source ~/.zshrc > /dev/null 2>&1; fi
if [ -f ~/.profile ]; then source ~/.profile > /dev/null 2>&1; fi

# Run the script and capture output
python3 /home/thesage/.hermes/scripts/morning_briefing.py
