# Source this file (". tools/env.sh") to use the bundled build tools.
TOOLS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
export PATH="$TOOLS_DIR/bin:$TOOLS_DIR/venv/bin:$PATH"
export TECTONIC_CACHE_DIR="$TOOLS_DIR/tectonic-cache"   # LaTeX packages and fonts, pre-downloaded
if [ ! -x "$TOOLS_DIR/venv/bin/python" ]; then
  python3 -m venv "$TOOLS_DIR/venv" && \
  "$TOOLS_DIR/venv/bin/pip" install -q --no-index --find-links "$TOOLS_DIR/wheels" -r "$TOOLS_DIR/requirements.txt"
fi
