pathadd() {
    if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
        PATH="$1:$PATH"
    fi
}

PROJECT_ROOT=$(dirname $0)
VIRTUAL_ENV_DIR=$PROJECT_ROOT/venv

if [[ ! -e "$VIRTUAL_ENV_DIR" ]]; then
    python3.6 -m venv $VIRTUAL_ENV_DIR
    . $VIRTUAL_ENV_DIR/bin/activate
    pip install -r requirements-dev.txt
fi

if [[ -z "$VIRTUAL_ENV" ]]; then
    . $VIRTUAL_ENV_DIR/bin/activate
    VIRTUAL_ENV=rds-log-streamer  # Make the name in the prompt look a bit nicer
fi

unset PROJECT_ROOT
unset VIRTUAL_ENV_DIR
