-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
30 lines (24 loc) · 1.14 KB
/
setup.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
# This script will work in either bash or zsh.
# deterine path to this script
# http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
SOURCE_HIGGSTAUTAU_SETUP="${BASH_SOURCE[0]:-$0}"
DIR_HIGGSTAUTAU_SETUP="$( dirname "$SOURCE_HIGGSTAUTAU_SETUP" )"
while [ -h "$SOURCE_HIGGSTAUTAU_SETUP" ]
do
SOURCE_HIGGSTAUTAU_SETUP="$(readlink "$SOURCE_HIGGSTAUTAU_SETUP")"
[[ $SOURCE_HIGGSTAUTAU_SETUP != /* ]] && SOURCE_HIGGSTAUTAU_SETUP="$DIR_HIGGSTAUTAU_SETUP/$SOURCE_HIGGSTAUTAU_SETUP"
DIR_HIGGSTAUTAU_SETUP="$( cd -P "$( dirname "$SOURCE_HIGGSTAUTAU_SETUP" )" && pwd )"
done
DIR_HIGGSTAUTAU_SETUP="$( cd -P "$( dirname "$SOURCE_HIGGSTAUTAU_SETUP" )" && pwd )"
echo "sourcing ${SOURCE_HIGGSTAUTAU_SETUP}..."
export HIGGSTAUTAU_DIR=$DIR_HIGGSTAUTAU_SETUP
export PATH=${DIR_HIGGSTAUTAU_SETUP}${PATH:+:$PATH}
export PYTHONPATH=${DIR_HIGGSTAUTAU_SETUP}${PYTHONPATH:+:$PYTHONPATH}
if [ -f ${DIR_HIGGSTAUTAU_SETUP}/externaltools/setup.sh ]
then
source ${DIR_HIGGSTAUTAU_SETUP}/externaltools/setup.sh
fi
if [ -f ${DIR_HIGGSTAUTAU_SETUP}/TauSpinnerTool/setup.sh ]
then
source ${DIR_HIGGSTAUTAU_SETUP}/TauSpinnerTool/setup.sh
fi