#!/bin/bash

VENV_DIR=~/venv_templateflow

if [ ! -e $VENV_DIR ]
then
#set up virtualenv with templateflow
module load python/3 && virtualenv $VENV_DIR && source $VENV_DIR/bin/activate && pip install templateflow && deactivate

fi

# update all templateflow templates
source $VENV_DIR/bin/activate && python -c "import templateflow.api as api; [api.get(template) for template in api.templates()]" && deactivate

