#!/usr/bin/env bash if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then echo "This helper must be sourced: source scripts/activate_psi_env.sh" >&2 exit 2 fi _psi_env_repo_root=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd) export PSI_VENV=${PSI_VENV:-$_psi_env_repo_root/.venv-psi} if [[ ! -x "$PSI_VENV/bin/python" || ! -f "$PSI_VENV/bin/activate" ]]; then echo "Project-local Psi environment is unavailable: $PSI_VENV" >&2 return 2 fi source "$PSI_VENV/bin/activate" unset _psi_env_repo_root