File indexing completed on 2026-04-25 08:29:08
0001 if echo "$SHELL" | grep -q bash ; then
0002 UsingBash="BashTrue"
0003 fi
0004 if echo "$SHELL" | grep -q zsh ; then
0005 UsingZsh="ZshTrue"
0006 fi
0007 if [ -z "$UsingBash" ] && [ -z "$UsingZsh" ]; then
0008 echo "This script must be run in bash or zsh"
0009 return 1
0010 fi
0011
0012 if [ $UsingBash ]; then
0013 echo "Running in bash, presumably in docker. Setting up venvdocker"
0014 if [ -z "$VIRTUAL_ENV" ]; then
0015 source /Users/eickolja/sphenix/venvdocker/bin/activate
0016 else
0017 echo "Using existing virtual environment: $VIRTUAL_ENV"
0018 fi
0019 fi
0020
0021 if [ $UsingZsh ]; then
0022 echo "Running in zsh. Setting up venvsphenix"
0023 if [ -z "$VIRTUAL_ENV" ]; then
0024 source /Users/eickolja/sphenix/venvsphenix/bin/activate
0025 else
0026 echo "Using existing virtual environment: $VIRTUAL_ENV"
0027 fi
0028 fi
0029
0030 echo "Setting up Test environment for sPHENIX Production (possibly inside Docker) on Mac."
0031
0032
0033
0034
0035 SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
0036 echo "Using scripts in: ${SCRIPT_DIR}"
0037
0038 export PATH=${PATH}:${HOME}/bin:./bin
0039 export ODBCINI=./odbc.ini
0040 export PYTHONPATH=${PYTHONPATH}:${SCRIPT_DIR}
0041 export PATH=${PATH}:${SCRIPT_DIR}
0042
0043 echo Using $(python --version)
0044
0045 parse_git_branch() {
0046 branch=$( git -C ${SCRIPT_DIR} rev-parse --abbrev-ref HEAD 2> /dev/null )
0047 local branch_color_status="\e[31m"
0048 if [ -z "$(git -C ${SCRIPT_DIR} status --porcelain -uno)" ]; then
0049 branch_color_status="\e[32m"
0050 fi
0051 pbranch=""
0052 pstatus=""
0053 if [ -e ProdFlow ]; then
0054 pbranch=$( git -C ./ProdFlow rev-parse --abbrev-ref HEAD 2> /dev/null )
0055 pstatus="\e[31m"
0056 if [ -z "$(git -C ./ProdFlow status --porcelain -uno)" ]; then
0057 pstatus="\e[32m"
0058 fi
0059 else
0060 pbranch=""
0061 pstatus="\e[31m"
0062 fi
0063
0064
0065
0066 gitstatus="${branch_color_status} prod:${branch}\e[0m"
0067 if [ -n "$pbranch" ]; then
0068
0069 gitstatus="${gitstatus} ${pstatus} prodflow:${pbranch}"
0070 fi
0071 echo -e "${gitstatus}\e[0m"
0072
0073 }
0074
0075 if [[ "$-" == *i* ]]; then
0076
0077 :
0078 else
0079 echo "Non-interactive shell"
0080 return 0
0081 fi
0082
0083
0084 alias cqb='condor_q -batch'
0085
0086 if [[ -n "$BASH_VERSION" ]]; then
0087
0088
0089
0090 PS1="\u@\h \W> "
0091 git config --global user.name "Kolja Kauder"
0092 git config --global user.email "kkauder@gmail.com"
0093 elif [[ -n "$ZSH_VERSION" ]]; then
0094
0095 PS1="%{[36m%}me@%m%{[33m%}%{[1;33m%} [%1~/]> %{[0m%}"
0096
0097 fi
0098