
# This file contains ONLY direnv-specific commands (stdlib functions).
# All project-specific environment variables should be placed in .env
# IMPORTANT: This file is committed to git. Do NOT add secrets here!
#            Add secrets to .env instead (which is gitignored).

# Load parent .envrc if it exists
source_up

# Setup Python 3 virtual environment
# The virtual environment will be created in .direnv/python-<version>
layout python3

# Add scripts directory to PATH
PATH_add ./scripts

# Load project-specific environment variables from .env file if it exists
# This includes DUPLO_* variables, credentials, and other configuration
dotenv_if_exists .env
openv_if_exists op.env

# Set git-related variables using command substitution
# These require shell execution and cannot be in .env (Docker --env-file doesn't support it)
export GIT_REF="$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo 'unknown')"
export GIT_TAG="$(git describe --tags --abbrev=0 2>/dev/null || echo 'unknown')"
export GIT_SHA="$(git rev-parse --short HEAD 2>/dev/null || echo 'unknown')"
