File size: 507 Bytes
9fc9873
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/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