forked from pulp-platform/pulp-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
28 lines (23 loc) · 896 Bytes
/
init.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
#!/bin/bash -e
add_path() {
export PATH=${PATH//":$1:"/:}
export PATH=${PATH/%":$1"/}
export PATH=${PATH/#"$1:"/}
export PATH="$1${PATH:+":$PATH"}"
}
add_PYTHONPATH() {
export PYTHONPATH=${PYTHONPATH//":$1:"/:}
export PYTHONPATH=${PYTHONPATH/%":$1"/}
export PYTHONPATH=${PYTHONPATH/#"$1:"/}
export PYTHONPATH="$1${PYTHONPATH:+":$PYTHONPATH"}"
}
scriptDir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
export PULP_PROJECT_HOME="$scriptDir"
echo "Configuring Pulp project at $PULP_PROJECT_HOME"
add_path $PULP_PROJECT_HOME/pulp-tools/bin
add_path $PULP_PROJECT_HOME/pulp-configs/bin
add_PYTHONPATH $PULP_PROJECT_HOME/pulp-tools/python
add_PYTHONPATH $PULP_PROJECT_HOME/pulp-configs/python
add_PYTHONPATH $PULP_PROJECT_HOME/pulp-configs/bin
add_PYTHONPATH $PULP_PROJECT_HOME/json-tools/python
export PULP_CONFIGS_PATH=$PULP_PROJECT_HOME/pulp-configs/configs