# NeutronOS direnv configuration
# Auto-activates the Python virtual environment when entering this directory
#
# Install direnv: brew install direnv
# Add to shell:   eval "$(direnv hook zsh)"  (or bash)
# Allow this file: direnv allow
#
# See https://direnv.net for more information

# Workaround for VS Code shell integration + zsh
# VS Code's hooks reference RPROMPT without checking if it's set, causing errors
# when 'set -u' (nounset) is active anywhere in the shell
export RPROMPT="${RPROMPT:-}"

# Try parent .venv first (workspace-level), then local
if [[ -f "../.venv/bin/activate" ]]; then
    source ../.venv/bin/activate
elif [[ -f ".venv/bin/activate" ]]; then
    source .venv/bin/activate
fi

# Load .env if present (for API keys, etc.)
dotenv_if_exists .env
