#!/bin/bash
# Morning briefing runner — loads env vars then executes the Python script.
# Copy to ~/.hermes/scripts/run_morning_briefing.sh and chmod +x.

set -e

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

# Fallback to user profile (silent)
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
python3 "/home/$USER/.hermes/scripts/morning_briefing.py"
