-
Notifications
You must be signed in to change notification settings - Fork 55
/
env.sh
24 lines (21 loc) · 2.52 KB
/
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
#!/bin/bash
realpath ()
{
f=$@;
if [ -d "$f" ]; then
base="";
dir="$f";
else
base="/$(basename "$f")";
dir=$(dirname "$f");
fi;
dir=$(cd "$dir" && /bin/pwd);
echo "$dir$base"
}
if [[ ${BASH_SOURCE[@]} == $0 ]] ; then
echo "Script is being run. Please source it instead."
else
export NC_ROOT=$(dirname $(realpath ${BASH_SOURCE[@]}))
export LD_LIBRARY_PATH="$NC_ROOT/lib:$LD_LIBRARY_PATH"
export PYTHONPATH="$NC_ROOT/lib:$PYTHONPATH"
fi