-
Notifications
You must be signed in to change notification settings - Fork 4
/
env.sh
32 lines (27 loc) · 1019 Bytes
/
env.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
action() {
# determine the directory of this file
local this_file="$( [ ! -z "$ZSH_VERSION" ] && echo "${(%):-%x}" || echo "${BASH_SOURCE[0]}" )"
local this_dir="$( cd "$( dirname "$this_file" )" && pwd )"
#export some paths
export PYTHONPATH="$this_dir:$PYTHONPATH"
export LAW_HOME="$this_dir/.law"
export LAW_CONFIG_FILE="$this_dir/law.cfg"
export RUN_PATH="$this_dir"
#setup private conda installation for env activation
PRIVATE_CONDA_INSTALL=/afs/cern.ch/work/p/pdebryas/miniconda3
__conda_setup="$($PRIVATE_CONDA_INSTALL/bin/conda shell.${SHELL##*/} hook)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "$PRIVATE_CONDA_INSTALL/etc/profile.d/conda.sh" ]; then
. "$PRIVATE_CONDA_INSTALL/etc/profile.d/conda.sh"
else
export PATH="$PRIVATE_CONDA_INSTALL/bin:$PATH"
fi
fi
unset __conda_setup
conda activate PnetEnv
source "$( law completion )" ""
}
action