#!/bin/bash
#
# Copyright (c) 2015 nexB Inc. http://www.nexb.com/ - All rights reserved.
#
################################
# change these variables to customize this script locally
################################
# you can define one or more thirdparty dirs, each prefixed with TPP_DIR
export TPP_DIR_BASE="thirdparty/base"
export TPP_DIR_PROD="thirdparty/prod"
export TPP_DIR_DEV="thirdparty/dev"

# default configurations
CONF_DEFAULT="etc/conf"
#################################

CFG_CMD_LINE_ARGS="$@"

if [ "$1" == "--init" ]; then
    CFG_CMD_LINE_ARGS=$CONF_INIT
fi

if [ "$1" == "" ]; then
    # default conf if not argument is provided
    CFG_CMD_LINE_ARGS=$CONF_DEFAULT
fi

CONFIGURE_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

python $CONFIGURE_ROOT_DIR/etc/configure.py $CFG_CMD_LINE_ARGS
if [ -f "$CONFIGURE_ROOT_DIR/bin/activate" ]; then
    source $CONFIGURE_ROOT_DIR/bin/activate
fi
