#!/usr/bin/env bash
if [[ ! ${PATH} == *"bazel_gdb"* ]]
then
    # https://stackoverflow.com/questions/59895/getting-the-source-directory-of-a-bash-script-from-within
    SOURCE="${BASH_SOURCE[0]}"
    while [ -h "$SOURCE" ]; do
        DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
        SOURCE="$(readlink "$SOURCE")"
        [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
    done
    DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"

    export PATH=$PATH:"$DIR"
fi
