# Same as deactivate in "/bin/activate" deactivate () { if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then PATH="${_OLD_VIRTUAL_PATH:-}" export PATH unset _OLD_VIRTUAL_PATH fi if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}" export PYTHONHOME unset _OLD_VIRTUAL_PYTHONHOME fi if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then hash -r 2> /dev/null fi if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then PS1="${_OLD_VIRTUAL_PS1:-}" export PS1 unset _OLD_VIRTUAL_PS1 fi unset VIRTUAL_ENV unset VIRTUAL_ENV_PROMPT if [ ! "${1:-}" = "nondestructive" ] ; then unset -f deactivate fi } # Get the directory of the current script SCRIPT_DIR=$(dirname "$0") # Construct the path to envVars.txt relative to the script directory ENV_FILE="$SCRIPT_DIR/envVars.txt" # Read the JSON file and set the variables TEMP_PS1=$(grep '^PS1=' $ENV_FILE | cut -d '=' -f 2) TEMP_PATH=$(grep '^PATH=' $ENV_FILE | cut -d '=' -f 2) TEMP_PYTHONHOME=$(grep '^PYTHONHOME=' $ENV_FILE | cut -d '=' -f 2) # Initialize the variables required by deactivate function _OLD_VIRTUAL_PS1="${TEMP_PS1:-}" _OLD_VIRTUAL_PATH="$TEMP_PATH" if [ -n "${PYTHONHOME:-}" ] ; then _OLD_VIRTUAL_PYTHONHOME="${TEMP_PYTHONHOME:-}" fi deactivate fish