# Source erk activation script if it exists
# This script:
#   - Creates .venv with `uv sync` if missing
#   - Activates the virtual environment
#   - Loads .env into the environment
#   - Sets up shell completion for erk
source_env_if_exists .erk/bin/activate.sh

# Rename cmux workspace to current git branch
if command -v cmux &>/dev/null; then
  _branch=$(git branch --show-current 2>/dev/null)
  if [ -n "$_branch" ]; then
    cmux rename-workspace "$_branch" 2>/dev/null || true
  fi
  unset _branch
fi
