distil-ui/tools/with_venv.sh
Fei Long Wang 502b3eb286 Init commit for Distil UI
Some specific Catalyst Cloud stuff are here and there, they will be cleaned
up later after we migrated to Distil v2.

Change-Id: I81df0765cfc876faaa58a43469d87825d30c167e
2017-04-10 11:35:31 +12:00

14 lines
506 B
Bash
Executable File

#!/bin/bash
TOOLS_PATH=${TOOLS_PATH:-$(dirname $0)}
VENV_PATH=${VENV_PATH:-${TOOLS_PATH}}
VENV_DIR=${VENV_NAME:-/../.venv}
TOOLS=${TOOLS_PATH}
VENV=${VENV:-${VENV_PATH}/${VENV_DIR}}
HORIZON_DIR=${TOOLS%/tools}
# This horrible mangling of the PYTHONPATH is required to get the
# babel-angular-gettext extractor to work. To fix this the extractor needs to
# be packaged on pypi and added to global requirements. That work is in progress.
export PYTHONPATH="$HORIZON_DIR"
source ${VENV}/bin/activate && "$@"