-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup_project.sh
27 lines (21 loc) · 911 Bytes
/
setup_project.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
PROJECT_DIRECTORY=$(pwd)
echo "creating empty data folder"
mkdir -p 'src/data'
CONFIGURATION_FILE='.bashrc_aff'
CONFIGURATION_PATH="$PROJECT_DIRECTORY/$CONFIGURATION_FILE"
echo "cleaning previous configuration (if any)"
echo "" > "$CONFIGURATION_PATH"
SOURCE_FOLDER='src'
SOURCE_PATH="$PROJECT_DIRECTORY/$SOURCE_FOLDER"
echo "adding project source to environment variables"
echo "export AFFORDANCE_SOURCE=$SOURCE_PATH" >> ./.bashrc_aff
echo "exporting project source path: $SOURCE_PATH"
echo "export PYTHONPATH=$PYTHONPATH:$SOURCE_PATH" >> ./.bashrc_aff
VENV_FILE='affordances_venv/bin/activate'
VENV_PATH="$PROJECT_DIRECTORY/$VENV_FILE"
echo "aliasing source-aff as source $VENV_PATH"
echo "alias source-aff='source $VENV_PATH'" >> ./.bashrc_aff
echo "source-aff" >> ./.bashrc_aff
echo "sourcing virtual environment"
source "$VENV_PATH"
echo "please source .bashrc_aff before running each python script"