-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbootstrap.sh
executable file
·33 lines (29 loc) · 977 Bytes
/
bootstrap.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
33
#!/bin/bash
# Common recipe for bootstraping omtk_compound, maya and it's dependencies.
function _APPEND() {
# $1: The name of the variable to append to
# $2: The value to append
echo "[setup] Append to $1: $2"
eval "$1=\$$1:$2"
}
function _PREPEND() {
# $1: The name of the variable to prepend to
# $2: The value to append
echo "[setup] Prepend to $1: $2"
eval "$1=$2:\$$1"
}
# Expose omtk
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
PYTHON_DIR="${DIR}/scripts"
_APPEND "PYTHONPATH" "${PYTHON_DIR}"
# Expose maya
_MAYA_BIN=$(readlink -f `command -v maya`)
_MAYA_DIR=$(dirname "${_MAYA_BIN}")
_MAYA_ROOT=$(dirname "${_MAYA_DIR}")
_PREPEND "PATH" "${_MAYA_DIR}"
_APPEND "LD_LIBRARY_PATH" "${_MAYA_ROOT}/lib"
_APPEND "PYTHONPATH" "${_MAYA_ROOT}/lib/python2.7/site-packages"
# Expose pytest
_PYTEST_BIN=$(python -c "import pytest; print pytest.__file__")
_PYTEST_DIR=$(dirname "${_PYTEST_BIN}")
_APPEND "PYTHONPATH" "${_PYTEST_DIR}"