if [ -n "$BASH_SOURCE" ]; then
  script_path="${BASH_SOURCE[0]}"
else
  script_path="$0"
fi
script_directory="$(dirname "$(readlink --canonicalize "$script_path")")"

source "$script_directory/common.sh"

export ZOOX_WORKSPACE_ROOT="$(bazel_root)"

# remove any previous bazel-bin from the path
STRIPPED_PATH=$(echo "$PATH" | sed 's|[^:]*/bazel-bin/[^:]*:||g')

# add bin from this workspace to the path
export PATH="$ZOOX_WORKSPACE_ROOT/bazel-bin/bin:$STRIPPED_PATH"
unset STRIPPED_PATH

# Set the base PYTHONPATH to point to the driving repo, but not keep a trailing colon
export PYTHONPATH="${ZOOX_WORKSPACE_ROOT}${PYTHONPATH:+:$PYTHONPATH}"

# One of the dependencies of Apache Airflow by default pulls in a GPL library (unidecode).
# To install non GPL library we need this.
export SLUGIFY_USES_TEXT_UNIDECODE=yes

export PATH="$HOME/.tfenv/bin:$PATH"

# Use Artifactory for GOPROXY. Bazel go_repository will respect this setting.
export GOPROXY=artifactory.zooxlabs.com/artifactory/api/go/go
